https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102262
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-09-09 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. Interesting only MSVC provides the reason: <source>(15): error C2131: expression did not evaluate to a constant <source>(11): note: failure was caused by call of undefined function or one not declared 'constexpr' <source>(11): note: see usage of 'foo<int>::~foo' clang does not either: <source>:15:16: error: static_assert expression is not an integral constant expression static_assert( check<foo<int>>() ); ^~~~~~~~~~~~~~~~~ <source>:11:5: note: non-literal type 'foo<int>' cannot be used in a constant expression T t; ^ <source>:15:16: note: in call to 'check()' static_assert( check<foo<int>>() ); ^ Nor EDG (ICC): <source>(15): error: expression must have a constant value static_assert( check<foo<int>>() ); ^ <source>(15): note: cannot call non-constexpr function "check<T>() [with T=foo<int>]" (declared at line 9) static_assert( check<foo<int>>() ); ^