| 1 |
// PR c++/89648 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template <typename T, T U> struct A { static const T e = U; }; |
| 5 |
template <typename> struct B; |
| 6 |
template <unsigned long, typename> struct C; |
| 7 |
template <long i, typename T> using E = typename C<i, T>::k; |
| 8 |
template <typename T, T...> struct F {}; |
| 9 |
template <typename T, T U> using G = F<T, __integer_pack(U)...>; |
| 10 |
template <unsigned long... U> using H = F<unsigned long, U...>; |
| 11 |
template <unsigned long U> using I = G<unsigned long, U>; |
| 12 |
template <typename...> class J {}; |
| 13 |
template <typename... U> struct B<J<U...>> : A<long, sizeof...(U)> {}; |
| 14 |
template <unsigned long N, typename T, typename... U> |
| 15 |
struct C<N, J<T, U...>> : C<N - 1, J<U...>> {}; |
| 16 |
template <typename T, typename... U> struct C<0, J<T, U...>> { typedef T k; }; |
| 17 |
template <unsigned long N, typename... U> E<N, J<U...>> qux (J<U...>); |
| 18 |
struct D { template <typename T> void foo (T) {} }; |
| 19 |
void bar (...); |
| 20 |
struct K { void baz (int &); int l; D m; int *n, o; }; |
| 21 |
template <typename T, typename U, typename V, unsigned long... W> |
| 22 |
void quux (int, int *, D x, int *, int, int, T, U, V y, H<W...>) { |
| 23 |
x.foo ([=] { bar (qux <W>(y)...); }); |
| 24 |
} |
| 25 |
void K::baz (int &x) { |
| 26 |
J<int, int> p; |
| 27 |
int q, r; |
| 28 |
long s; |
| 29 |
quux (x, &l, m, n, o, r, s, q, p, I<B<decltype(p)>::e> ()); |
| 30 |
} |