This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH,4.1,committed] Backport PR 28114 to 4.1 branch.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Jul 2006 13:26:21 -0700 (PDT)
- Subject: [PATCH,4.1,committed] Backport PR 28114 to 4.1 branch.
- Reply-to: sje at cup dot hp dot com
This regression fix (and test) were approved and checked in on the
mainline. I am going to check them in on the 4.1 branch as well. The
patch did not apply cleanly to the 4.0 branch so I am going to skip that
branch. The bug was reported against 4.0.4.
2006-07-10 Steve Ellcey <sje@cup.hp.com>
PR c++/28114
* name-lookup.c (pushtag): Return if we have error_mark_node.
Index: cp/name-lookup.c
===================================================================
--- cp/name-lookup.c (revision 114878)
+++ cp/name-lookup.c (working copy)
@@ -4872,7 +4872,11 @@ pushtag (tree name, tree type, tag_scope
pushdecl_class_level (decl);
}
else if (b->kind != sk_template_parms)
- decl = pushdecl_with_scope (decl, b, /*is_friend=*/false);
+ {
+ decl = pushdecl_with_scope (decl, b, /*is_friend=*/false);
+ if (decl == error_mark_node)
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
+ }
TYPE_CONTEXT (type) = DECL_CONTEXT (decl);
2006-07-10 Steve Ellcey <sje@cup.hp.com>
PR c++/28114
* g++.dg/other/pr28114.C: New.
Index: pr28114.C
===================================================================
--- pr28114.C (revision 0)
+++ pr28114.C (revision 0)
@@ -0,0 +1,7 @@
+
+template<int> void foo(struct {}*); // { dg-error "" }
+
+void bar()
+{
+ foo<0>(0); // { dg-error "" }
+}