From: Jason Merrill Date: Sat, 5 Apr 2025 03:27:50 +0000 (-0400) Subject: c++: add assert to cp_make_fname_decl X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eff4dc423327682d4b1e32f0122d9e973e3c6f99;p=thirdparty%2Fgcc.git 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 --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 4e97093b134..84398e5952a 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 {