------- Comment #8 from reichelt at igpm dot rwth-aachen dot de  2006-07-11 
09:15 -------
Subject: Re:  [4.0/4.1 regression] ICE with struct definition in
 argument of template function

On 10 Jul, sje at cup dot hp dot com wrote:
> 
> 
> ------- Comment #7 from sje at cup dot hp dot com  2006-07-10 20:46 -------
> I have checked in a patch for ToT and on the 4.1 branch.  My inclination is to
> not fix this on the 4.0 branch because the patch doesn't apply automatically. 
> The same change is probably needed somewhere else for 4.0, but I don't think 
> it
> is worth the trouble to find out where.

Well, with some trivial changes (whitespace, different number of
parameters for pushdecl_with_scope) the patch applies to the 4.0 branch:

===================================================================
--- gcc/gcc/cp/name-lookup.c    (revision 115324)
+++ gcc/gcc/cp/name-lookup.c    (working copy)
@@ -4666,7 +4666,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);
+           {
+             decl = pushdecl_with_scope (decl, b);
+             if (decl == error_mark_node)
+               POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, decl);
+           }

          /* FIXME what if it gets a name from typedef?  */
          if (ANON_AGGRNAME_P (name))
===================================================================

Would you mind testing this on the 4.0 branch? Or should I do that?

> Should I close this out as  fixed in 4.1.2?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28114

Reply via email to