[Bug c++/105300] [10/11/12/13 Regression] segfault from static_assert with user-defined string suffix argument
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 3 00:21:54 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105300
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.5
Known to fail| |6.1.0
Summary|segfault from static_assert |[10/11/12/13 Regression]
|with user-defined string |segfault from static_assert
|suffix argument |with user-defined string
| |suffix argument
Keywords| |diagnostic
Known to work| |5.5.0
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
MSVC produces a decent error message:
<source>(2): error C3690: expected a string literal, but found a user-defined
string literal instead
Note best definition of the operator is just:
void operator""_x(const char *, decltype(sizeof(0)));
static_assert(false, "foo"_x);
Oh we started to ICE between GCC 5 and 6. Most likely when we started to print
out the message too.
More information about the Gcc-bugs
mailing list