summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/vaarg.C
blob: c5a8c804ed2dbd108a94c42743f25764472a3795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// { dg-do run  }
#include <stdarg.h>

extern "C" void abort();

template <class T>
T* f(T t, ...)
{
  va_list ap;

  va_start(ap, t);
  T* r = va_arg(ap, T*);
  va_end(ap);

  return r;
}


struct S 
{
};

int main()
{
  S s;

  if (f(s, &s) != &s)
    abort();
}