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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
           Keywords|                            |error-recovery

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The question is how much is reflect.cc prepared to see error_mark_node at
various spots.
This particular error recovery can be fixed with
--- gcc/cp/reflect.cc.jj        2026-05-22 14:52:58.000000000 +0200
+++ gcc/cp/reflect.cc   2026-05-22 15:39:41.609718603 +0200
@@ -2789,6 +2789,11 @@ eval_constant_of (location_t loc, const
     type = type_of (r, kind);
   else
     type = maybe_strip_typedefs (r);
+  if (type == error_mark_node)
+    {
+      *non_constant_p = true;
+      return NULL_TREE;
+    }

   /* So that outer_automatic_var_p works below in check_splice_expr.  */
   temp_override<tree> ovr (current_function_decl);

Reply via email to