// PR c++/56395 struct A { template struct B { }; }; template struct D { }; template struct C { typedef T _Type; typedef typename T::template B<_Type> _BType; D<_BType> d; }; template struct C { typedef T _Type; typedef typename T::template B<_Type> _BType; D<_BType> d; }; C c;