Skip to content

noexcept specifiers are evaluated incorrectly #36907

@lukasm91

Description

@lukasm91
mannequin
Bugzilla Link 37559
Version trunk
OS Linux
CC @DougGregor,@zygoloid

Extended Description

There seem to be some problems about the point where noexcept specifiers are evaluated. I.e., this code does not compile:

void some_function() noexcept;

class V1 {
// does not compile
void f() noexcept(noexcept(some_function()));
decltype(&V1::f) f2;
};

class V2 {
// does not compile
void f() noexcept(true);
decltype(&V2::f) f2;
};

class V3 {
// compiles
void f() noexcept;
decltype(&V3::f) f2;
};

due to

:5:17: error: exception specification is not available until end of class definition

decltype(&V1::f) f2;

            ^
:11:17: error: exception specification is not available until end of class definition

decltype(&V2::f) f2;

            ^

2 errors generated.

Compiler returned: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions