1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Origin: PR c++/42915 // { dg-do compile } template <typename T> class A { template <typename U> class B { B foo(); }; }; template <typename T> template <typename U> A<T>::B<U> A<T>::B<U>::foo() {}