This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH,4.1,committed] Backport PR 28114 to 4.1 branch.


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 "" }
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]