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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Something like:
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
index 7c5f90b5127..185e0ac53f7 100644
--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -11203,6 +11203,13 @@ finish_static_assert (tree condition, tree message,
location_t location,
   if (check_for_bare_parameter_packs (condition))
     condition = error_mark_node;

+  if (TREE_CODE (message) != STRING_CST)
+    {
+      location_t mloc = cp_expr_loc_or_loc (message, location);
+      error_at (mloc, "user defined suffix not expected here");
+      return;
+    }
+
   if (instantiation_dependent_expression_p (condition))
     {
       /* We're in a template; build a STATIC_ASSERT and put it in


Should fix this I think ....

Reply via email to