OSDN Git Service

2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / variadic68.C
1 // { dg-do "run" }
2 // { dg-options "-std=gnu++0x" }
3 extern "C" void abort();
4
5 template<typename T, T... Values>
6 void f(T* expected_values, int n)
7 {
8   if (sizeof...(Values) != n)
9     abort ();
10
11   T values[] = { Values... };
12   for (int i = 0; i < n; ++i)
13     if (values[i] != expected_values[i])
14       abort();
15 }
16
17 int main()
18 {
19   int test_arr1[3] = { 1, 2, 3 };
20   f<int, 1, 2, 3>(test_arr1, 3);
21
22   return 0;
23 }