This example: struct S { int x = 42; /* not constexpr */ ~S() { } }; consteval auto make() -> S { return S(); } int main() { S s = make(); } When compiled with gcc 15.2 -std=c++26 produces this diagnostic: <source>: In function 'int main()': <source>:10:15: error: call to consteval function 'make()' is not a constant expression 10 | S s = make(); | ~~~~^~ <source>:10:15: error: 'consteval S make()' called in a constant expression <source>:7:16: note: 'consteval S make()' is not usable as a 'constexpr' function because: 7 | consteval auto make() -> S { return S(); } | ^~~~ It's not usable as a constexpr function because... why? Can we get a hint?
Dup. *** This bug has been marked as a duplicate of bug 102262 ***