14 // Here we declare A::S
18 template<class T, class U> class XX;
20 template<class T, class U>
24 static T *do_something ();
25 friend class T; // ERROR - `T' is a template parameter
26 friend class XX<T, U>;
31 // Here we declare N::S
36 // Should use N::S and A::S.
37 typedef X<S, A::S> X_S;
45 // X_S is template class X<N::S, A::S>
47 S *s = X_S::do_something ();