1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
template <typename T> struct A { typedef int X; }; template <typename T> struct B { typename A<T>::X x; }; template <typename T> struct C { void foo(int); B<A<T>*> b; }; template <typename T> struct D { enum { e }; void bar() { C<T*>::foo(e); } };