// RUN: clang-cc -fsyntax-only -verify %s // PR5057 namespace std { class X { public: template friend struct Y; }; } namespace std { template struct Y { }; } namespace N { template void f1(T) { } // expected-note{{here}} class X { template friend void f0(T); template friend void f1(T); }; template void f0(T) { } template void f1(T) { } // expected-error{{redefinition}} } // PR4768 template struct X0 { template friend struct X0; }; template struct X0 { template friend struct X0; }; template<> struct X0 { template friend struct X0; }; template struct X1 { template friend void f2(U); template friend void f3(U); }; template void f2(U); X1 x1i; X0 x0ip; template<> void f2(int); // FIXME: Should this declaration of f3 be required for the specialization of // f3 (further below) to work? GCC and EDG don't require it, we do... template void f3(U); template<> void f3(int); // PR5332 template class Foo { template friend class Foo; }; Foo foo; template struct X2a; template struct X2b; template class X3 { template friend struct X2a; template friend struct X2b; }; X3 x3i; // okay X3 x3l; // FIXME: should cause an instantiation-time failure