// PR c++/96673 // { dg-do compile { target c++11 } } template class A {}; template class B; template class C { private: friend class B; explicit C(A&) {}; }; template class B { public: B() = default; //B() {}; // << This implementation of the constructor makes it work A a = {}; C c = C{a}; }; int main() { auto b = B{}; auto &c = b.c; }