aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2025-04-04 23:27:50 -0400
committerJason Merrill <jason@redhat.com>2025-04-17 13:19:17 -0400
commiteff4dc423327682d4b1e32f0122d9e973e3c6f99 (patch)
treeff2057b602d9fbfcb0a091966aa2ff4803303d7a
parent47b62be9cace0e2e124650f331788d52ffd5fb25 (diff)
downloadgcc-eff4dc423327682d4b1e32f0122d9e973e3c6f99.zip
gcc-eff4dc423327682d4b1e32f0122d9e973e3c6f99.tar.gz
gcc-eff4dc423327682d4b1e32f0122d9e973e3c6f99.tar.bz2
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.
-rw-r--r--gcc/cp/decl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index 4e97093..84398e5 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
{