-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Closed
Copy link
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partyconstevalC++20 constevalC++20 consteval
Description
If consteval function called in method initializer and this class used in both consteval and not consteval functions, compilation fails with
<source>:4:17: error: cannot take address of consteval function 'baz' outside of an immediate invocation
int mSize = baz();
consteval int baz() { return 0;}
struct S {
int mSize = baz();
};
consteval void bar() {
S s;
}
void foo() {
S s;
}This bug is present in 16.x.x and >=18.0.0. (https://godbolt.org/z/o6EnWvvW7)
Issue was introduced in ca61961
After it was fixed in 4676885
And happens again after baf6bd3
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyVerified by a second partyconstevalC++20 constevalC++20 consteval