// { dg-do assemble } // Here we declare ::S typedef struct s1 *S; struct s1 { int s; }; struct A { // Here we declare A::S typedef struct s1 *S; }; template class XX; template class X { public: static T *do_something (); friend class T; // { dg-error "" } `T' is a template parameter friend class XX; }; struct N { // Here we declare N::S class S { }; // Should use N::S and A::S. typedef X X_S; void bug (); }; void N::bug () { // X_S is template class X // `s' is N::S. S *s = X_S::do_something (); }