You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constevalintid(int i) { return i; }
structA {
int x;
int y = id(x);
} a{42};
Clang rejects this:
<source>:5:11: error: call to consteval function 'id' is not a constant expression
5 | int y = id(x);
| ^
<source>:6:7: note: in the default initializer of 'y'
6 | } a{42};
| ^
<source>:5:3: note: declared here
5 | int y = id(x);
| ^
<source>:5:14: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function
5 | int y = id(x);
| ^