// RUN: %clang_cc1 -fsyntax-only -verify %s namespace test0 { template class A { class Member {}; }; class B { template friend class A::Member; // expected-warning {{not supported}} int n; }; A a; B b; } // rdar://problem/8204127 namespace test1 { template struct A; class C { static void foo(); template friend void A::f(); // expected-warning {{not supported}} }; template struct A { void f() { C::foo(); } }; template struct A { void f() { C::foo(); } }; template <> struct A { void f() { C::foo(); } }; } // FIXME: these should fail! namespace test2 { template struct A; class C { static void foo(); template friend void A::g(); // expected-warning {{not supported}} }; template struct A { void f() { C::foo(); } }; template struct A { void f() { C::foo(); } }; template <> struct A { void f() { C::foo(); } }; } // Tests 3, 4 and 5 were all noted in . namespace test3 { template struct A { struct Inner { static int foo(); }; }; template class C { int i; template friend struct A::Inner; // expected-warning {{not supported}} }; template int A::Inner::foo() { C c; c.i = 0; return 0; } int test = A::Inner::foo(); } namespace test4 { template struct X { template void operator+=(U); template template friend void X::operator+=(U); // expected-warning {{not supported}} }; void test() { X() += 1.0; } } namespace test5 { template