]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add assert to cp_make_fname_decl
authorJason Merrill <jason@redhat.com>
Sat, 5 Apr 2025 03:27:50 +0000 (23:27 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 17 Apr 2025 17:19:17 +0000 (13:19 -0400)
In the PR118629 testcase, pushdecl_outermost_localscope was failing and
returning error_mark_node without ever actually giving an error; in addition
to my earlier fix for the failure, make sure failures aren't silent.

gcc/cp/ChangeLog:

* decl.cc (cp_make_fname_decl): Prevent silent failure.

gcc/cp/decl.cc

index 4e97093b1341d0e62be97963436d91321db383ca..84398e5952a176b40c679191a3e0bf9a14b2128e 100644 (file)
@@ -5339,6 +5339,8 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep)
       decl = pushdecl_outermost_localscope (decl);
       if (decl != error_mark_node)
        add_decl_expr (decl);
+      else
+       gcc_assert (seen_error ());
     }
   else
     {