http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48010
fabien at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|fabien at gcc dot gnu.org |unassigned at gcc dot | |gnu.org --- Comment #3 from fabien at gcc dot gnu.org 2011-03-16 22:37:56 UTC --- Index: name-lookup.c =================================================================== --- name-lookup.c (revision 170721) +++ name-lookup.c (working copy) @@ -459,7 +459,8 @@ supplement_binding (cxx_binding *binding && DECL_ANTICIPATED (bval) && !DECL_HIDDEN_FRIEND_P (bval))) binding->value = decl; - else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)) + else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval) + && TREE_CODE (decl) != TYPE_DECL) { /* The old binding was a type name. It was placed in VALUE field because it was thought, at the point it was I've tried the patch above, but it raises another (complicated) issue. The below reduced testcase no longer compile. While instanciating A<int>, two decl of 'b' reach push_class_level_binding, and with the patch above, the second call to supplement_binding no longer succeeds. template <class> struct A { typedef struct {} b; }; template class A<int>; I don't know if we are wrongly instanciating something or if we need to treat specially a typedef to an anonymous struct in supplement_binding.Unless someone gives me hint, I give up.