// PR c++/95888 // { dg-do compile { target c++11 } } template class A { A(int, int); template friend class A; friend T; }; template struct B { template struct C { A begin() { return {1, 0}; } }; template C fn(); }; int main () { B b; b.fn().begin(); }