OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [variadic80.C] - Rev 320

Go to most recent revision | Compare with Previous | Blame | View Log

// PR c++/31434
// { dg-do run }
// { dg-options "-std=c++0x" }

extern "C" void abort ();

template<typename... T> inline int foo (const T...) { return 1; }
template<typename... T> inline int foo (const T *...) { return 2; }

void
bar (int *a)
{
  a[0] = foo (0);
  a[1] = foo (*a);
  a[2] = foo<int> (a);
  a[3] = foo<int> (2, 3, 4, 5);
  a[4] = foo<int> (a, a + 1, a + 2);
}

int
main ()
{
  int a[5];
  bar (a);
  if (a[0] != 1 || a[1] != 1 || a[2] != 2 || a[3] != 1 || a[4] != 2)
    abort ();
  return 0;
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.