// PR c++/41305 // We got into infinite recursion instantiating the B series. template struct A { }; template > struct B; template struct C { }; template struct B: C > { friend void f(B) { } }; B b; int main() { f(b); }