Skip to content

is_invokable_v<void> does not compile #39841

Closed

Description

@AlisdairM
mannequin
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.

Activity

  1. AlisdairM commented on Jan 28, 2019

    AlisdairMmannequin
    MannequinAuthor

    assigned to @mclow

  2. AlisdairM commented on Jan 28, 2019

    AlisdairMmannequin
    MannequinAuthor

    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.

  3. AlisdairM commented on Jan 28, 2019

    AlisdairMmannequin
    MannequinAuthor

    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.

  4. mclow commented on Jan 28, 2019

    @mclow
    Contributor

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

  5. mclow commented on Jan 29, 2019

    @mclow
    Contributor
  6. AlisdairM commented on Jan 29, 2019

    AlisdairMmannequin
    MannequinAuthor

    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

  7. llvmbot commented on Jan 29, 2019

    @llvmbot
    Member

    Fixed in r352522.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions