Skip to content

Implement CWG 1780 #26540

@llvmbot

Description

@llvmbot
Bugzilla Link 26166
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor

Extended Description

auto l = [] () -> void {};
struct s {friend void decltype(l)::operator()() const;};

The above spuriously succeeds.

NB: For unbeknown reasons, the trailing return type is necessary. How come the return type differs from void if it isn't supplied? E.g. in the same sample program without -> void, the assertion

static_assert(std::is_same<decltype(&decltype(l)::operator()), void(decltype(l)::*)() const>{});

succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepts-invalidbugzillaIssues migrated from bugzillac++17clang:frontendLanguage frontend issues, e.g. anything involving "Sema"cwg-issueAn issue that was filed to the Core Working GrouplambdaC++11 lambda expressions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions