LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 40495 - is_invokable_v<void> does not compile
Summary: is_invokable_v<void> does not compile
Status: RESOLVED FIXED
Alias: None
Product: libc++
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: 7.0
Hardware: PC All
: P enhancement
Assignee: Marshall Clow (home)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-28 06:26 PST by Alisdair Meredith
Modified: 2019-01-29 10:01 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alisdair Meredith 2019-01-28 06:26:42 PST
The simple test expression:
  static_assert(!std::is_invokable_v<void>);
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.
Comment 1 Alisdair Meredith 2019-01-28 06:30:10 PST
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.
Comment 2 Alisdair Meredith 2019-01-28 06:33:20 PST
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.
Comment 3 Marshall Clow (home) 2019-01-28 06:44:07 PST
Minor nit: I was unable to reproduce this as submitted. But when I spelled it correctly ("is_invocable_v"), then I got the error.
Comment 4 Marshall Clow (home) 2019-01-28 18:10:50 PST
https://llvm.org/D57364 up for review.
Comment 5 Alisdair Meredith 2019-01-29 05:44:32 PST
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
Comment 6 Eric Fiselier 2019-01-29 10:01:41 PST
Fixed in r352522.