https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107861
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Markus F.X.J. Oberhumer from comment #6) > Please note that I'm explicitly using "int_max" and not "INT_MAX", It's a constexpr variable with the same value, so that makes no difference whatsoever. > and I'd > appreciate if you could give me a link where the standard says this is > "ill-formed". Thanks! The condition is a static assert must be a constant-expression (C++20 9.1 [dcl.pre] paragraph 6). int_max+1 is not a core constant (C++20 7.7 [expr.const] paragraph 5, bullet 5.7), so is not usable as the condition in a static_assert, so the program is ill-formed.