// { dg-do run } // Test that template friends referring to class template members are // respected. template struct A { int f (T); struct AI { int f (T); }; }; class B { template friend int A::f (T); template friend struct A::AI; int a; // { dg-bogus "" "" { xfail *-*-* } } public: B(): a(0) { } }; template int A::f (T) { B b; return b.a; } template int A::AI::f (T) { B b; return b.a; // { dg-bogus "" "" { xfail *-*-* } } } int main () { A a; A::AI ai; int r = a.f (0); r |= ai.f (0); return r; }