// { dg-do compile } // Origin: Debian GCC maintainers // Volker Reichelt // PR c++/16706: Dependent type calculation during access checking template struct A { A(); template struct X {}; }; template struct B { typename A::template X x; template struct C; }; template template struct B::C { C() {} A a; }; template struct B::C;