1// Contributed by Dodji Seketeli <dodji@redhat.com> 2// Origin PR c++/42225 3// { dg-do compile } 4 5template<class T> 6struct A 7{ 8 typedef T I; 9}; 10 11template<class T, int> 12struct B 13{ 14 typedef T TT; 15 typedef typename TT::I TT_I; 16 typedef A<TT_I> TA; 17}; 18 19template<class T> 20void 21foo() 22{ 23 typedef T TT; 24 typedef typename TT::I TT_I; 25 typedef A<TT_I> TA; 26} 27 28int 29main() 30{ 31 foo<A<int> >(); 32} 33 34