1 // { dg-do compile } 2 3 // Origin: David Abrahams <dave@boost-consulting.com> 4 // Wolfgang Bangerth <bangerth@ticam.utexas.edu> 5 6 // PR c++/12170: Deducing template template parameter from nested 7 // class template. 8 9 template <typename> struct W {}; 10 11 template< template<typename> class F, typename T> 12 int foo(W< F<T> >); 13 14 15 template<typename T> 16 struct L { 17 static int const value = sizeof(foo(W<T>())); 18 typedef T type; 19 }; 20 21 22 template <typename> 23 struct Y { 24 template <typename> struct X { typedef int type; }; 25 typedef typename L<X<int> >::type type; 26 }; 27 28 template struct Y<int>; 29