* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / variadic-init.C
blobac072c6b54230e9b3ed825b9f11a1ee92bf69961
1 // { dg-do run { target c++11 } }
3 // PR c++/33510
4 #define SIZE_FROM_CTOR
5 extern "C" void abort ();
7 template<int M, int N> struct pair
9   int i, j;
10   pair () : i (M), j (N) {}
13 template<int... M> struct S
15   template<int... N> static int *foo ()
16   {
17 #ifdef SIZE_FROM_CTOR
18     static int x[] = { (M + N)..., -1 };
19 #else
20     static int x[1 + sizeof... N] = { (M + N)..., -1 };
21 #endif
22     return x;
23   }
26 template<typename... M> struct R
28   template<typename... N> static int *foo ()
29   {
30 #ifdef SIZE_FROM_CTOR
31     static int x[] = { (sizeof(M) + sizeof(N))..., -1 };
32 #else
33     static int x[1 + sizeof... N] = { (sizeof(M) + sizeof(N))..., -1 };
34 #endif
35     return x;
36   }
39 int *bar ()
41   return S<0, 1, 2>::foo<0, 1, 2> ();
44 int *baz ()
46   return R<char, short, int>::foo<float, double, long> ();
50 int main ()
52   int *p = bar ();
53   if (p[0] != 0 || p[1] != 2 || p[2] != 4 || p[3] != -1)
54     abort ();