[Bug c++/123203] typo in static_assert gives confusing and verbose diagnostics

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 18 14:37:00 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123203

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Clang just says:

sa.cc:2:22: error: expected ','
    2 | static_assert( test() };
      |                      ^
      |                      ,
1 error generated.


This is much less noisy, but not great. It doesn't point out the brace instead
of paren, and the suggestion wouldn't actually fix the code, it would just
cause a different error because then it would be expecting a string literal and
would still have the brace.


More information about the Gcc-bugs mailing list