summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/variadic68.C
blob: 07cf8e3896ad66e473d34ac14e4b575f57430b24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do run }
// { dg-options "-std=gnu++0x" }
extern "C" void abort();

template<typename T, T... Values>
void f(T* expected_values, int n)
{
  if (sizeof...(Values) != n)
    abort ();

  T values[] = { Values... };
  for (int i = 0; i < n; ++i)
    if (values[i] != expected_values[i])
      abort();
}

int main()
{
  int test_arr1[3] = { 1, 2, 3 };
  f<int, 1, 2, 3>(test_arr1, 3);

  return 0;
}