Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_invokable_v<void> does not compile #39841

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

is_invokable_v<void> does not compile #39841

AlisdairM mannequin opened this issue Jan 28, 2019 · 7 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@AlisdairM
Copy link
Mannequin

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 mannequin commented Jan 28, 2019

assigned to @mclow

@AlisdairM
Copy link
Mannequin Author

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.

@AlisdairM
Copy link
Mannequin Author

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.

@mclow
Copy link
Contributor

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.

@mclow
Copy link
Contributor

mclow commented Jan 29, 2019

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

@AlisdairM
Copy link
Mannequin Author

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

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 29, 2019

Fixed in r352522.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

2 participants