// PR c++/15701 template class T> struct A : T<0> { void foo(); template class U> friend void A::foo(); }; template struct B {}; A a;