1// Various tests for variadic templates and partial specialization. 2// { dg-do compile { target c++11 } } 3 4// PR c++/36846 5template<typename A, typename B> 6struct pair; 7 8template<typename... T> 9struct pairs; 10 11template<typename... AS, typename... BS> 12struct pairs<pair<AS, BS>...> { 13 struct mismatched_packs {}; 14}; 15 16template class pairs< 17 pair<int, int>, 18 pair<int, int> 19>; 20 21template<int A, int B> 22struct point; 23 24template<typename... T> 25struct points; 26 27template<int... AS, int... BS> 28struct points<point<AS, BS>...> { 29 struct mismatched_packs {}; 30}; 31 32template class points< 33 point<0, 1>, 34 point<0, 1> 35>; 36 37// PR c++/35477 38template <class...ARGS> struct tuple {}; 39template <class A, class B> struct test {}; 40template <class... ARGS, class B> struct test<B, tuple<ARGS...>> 41{ 42 template <class T> struct inside {}; 43}; 44 45// PR c++/38276 46template<typename...> struct A; 47 48template<typename, typename> struct B; 49 50template<typename... T, typename... U> struct B<A<T...>, A<U...> > 51{ 52 static int i; 53}; 54 55B<A<>, A<int> > b1; 56 57B<A<int>, A<> > b2; 58 59// PR c++/35784 60template <typename...> struct p; 61 62template <typename, typename> struct d; 63 64template <typename... A, typename... B> 65struct d<p<A...>, p<B...> > { typedef int t; }; 66 67typedef d<p<>, p<int, float> >::t q; 68typedef d<q, d<p<int>, p<float> >::t> r; // * 69 70typedef d<d<p<>, p<int, float> >::t, d<p<>, p<> >::t> s; 71