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.
This commit is contained in:
Jason Merrill 2025-04-04 23:27:50 -04:00
parent 47b62be9ca
commit eff4dc4233

View 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
{