According to https://godbolt.org/z/XzT1wz, compiles in 8.3 and trunk. Fails compilation on 9.2. constexpr float f() { float x = 42; ++x; return x; } void g() { constexpr float x = f(); } <source>: In function 'void g()': <source>:2:33: in 'constexpr' expansion of 'f()' <source>:2:34: error: '((float)1 + 4.2e+1f)' is not a constant expression 2 | void g() { constexpr float x = f(); } | ^
Fixed around a week ago: 91705 *** This bug has been marked as a duplicate of bug 91705 ***