https://gcc.gnu.org/g:eff4dc423327682d4b1e32f0122d9e973e3c6f99

commit r16-5-geff4dc423327682d4b1e32f0122d9e973e3c6f99
Author: Jason Merrill <ja...@redhat.com>
Date:   Fri Apr 4 23:27:50 2025 -0400

    c++: add assert to cp_make_fname_decl
    
    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.

Diff:
---
 gcc/cp/decl.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index 4e97093b1341..84398e5952a1 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -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
     {

Reply via email to