aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/name-lookup.cc6
-rw-r--r--gcc/testsuite/g++.dg/parse/crash80.C7
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
index d1abb20..742e5d2 100644
--- a/gcc/cp/name-lookup.cc
+++ b/gcc/cp/name-lookup.cc
@@ -5101,10 +5101,8 @@ set_identifier_type_value_with_scope (tree id, tree decl, cp_binding_level *b)
if (b->kind == sk_namespace)
/* At namespace scope we should not see an identifier type value. */
gcc_checking_assert (!REAL_IDENTIFIER_TYPE_VALUE (id)
- /* We could be pushing a friend underneath a template
- parm (ill-formed). */
- || (TEMPLATE_PARM_P
- (TYPE_NAME (REAL_IDENTIFIER_TYPE_VALUE (id)))));
+ /* But we might end up here with ill-formed input. */
+ || seen_error ());
else
{
/* Push the current type value, so we can restore it later */
diff --git a/gcc/testsuite/g++.dg/parse/crash80.C b/gcc/testsuite/g++.dg/parse/crash80.C
new file mode 100644
index 0000000..cd9216a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash80.C
@@ -0,0 +1,7 @@
+// PR c++/116740
+// { dg-do "compile" }
+
+class K {
+ int a(struct b; // { dg-error "expected '\\)'" }
+};
+struct b {};