Skip to content
This repository has been archived by the owner. It is now read-only.

is_invokable_v<void> does not compile #40495

Closed
AlisdairM mannequin opened this issue Jan 28, 2019 · 7 comments
Closed

is_invokable_v<void> does not compile #40495

AlisdairM mannequin opened this issue Jan 28, 2019 · 7 comments
Assignees

Comments

@AlisdairM
Copy link
Mannequin

@AlisdairM AlisdairM mannequin commented Jan 28, 2019

Bugzilla Link 40495
Resolution FIXED
Resolved on Jan 29, 2019 10:01
Version 7.0
OS All
CC @mclow

Extended Description

The simple test expression:
static_assert(!std::is_invokable_v);
is expected to compile, but libc++ rejects this as 'void' is not a complete type.

According to the standard, the requirements on "Fn" are:

"Fn and all types in the template parameter pack ArgTypes shall be complete types, cv void, or arrays of unknown bound."

This may be boiler-plate standardese for handling incomplete types that merits an LWG issue instead, but note that gcc handles this case correctly.

@AlisdairM
Copy link
Mannequin Author

@AlisdairM AlisdairM mannequin commented Jan 28, 2019

assigned to @mclow

Loading

@AlisdairM
Copy link
Mannequin Author

@AlisdairM AlisdairM mannequin commented Jan 28, 2019

Oops, please withdraw - it turns out I was accidentally compiling with the Apple default Clang 6, which presumably predates the standard changing. Clang 7 lib handles this correctly.

Sorry for the noise.

Loading

@AlisdairM
Copy link
Mannequin Author

@AlisdairM AlisdairM mannequin commented Jan 28, 2019

Aaargh! Even more noise - and a resubmit!

It is still failing, but for a different reason since Clang 7.
Looks like my successful build was an off-by-one in my command line history and I re-ran the gcc test.

Loading

@mclow
Copy link

@mclow mclow commented Jan 28, 2019

Minor nit: I was unable to reproduce this as submitted. But when I spelled it correctly ("is_invocable_v"), then I got the error.

Loading

@mclow
Copy link

@mclow mclow commented Jan 29, 2019

https://llvm.org/D57364 up for review.

Loading

@AlisdairM
Copy link
Mannequin Author

@AlisdairM AlisdairM mannequin commented Jan 29, 2019

You may want to add an abominable function to the test harness, as it seems they also fail, e.g.,
int( ) &
int(...) &
int( ) & noexcept
int(...) & noexcept

Loading

@llvmbot
Copy link
Collaborator

@llvmbot llvmbot commented Jan 29, 2019

Fixed in r352522.

Loading

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants