2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / vaarg2.C
blobebdc5d7ec3f774c5f770e44e605530c0012b1c57
1 // { dg-do assemble  }
2 // Copyright (C) 2000 Free Software Foundation
3 // Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com>
5 // Origin GNATS bug report 63 from Kurt Garloff <garloff@tue.nl>
6 // We attempted to expand va_arg prematurely in a template function.
8 #include <stdarg.h>
10 template <class Type>
11 void PrintArgs (Type somearg, ...)
12
13 va_list argp;
14 va_start (argp, somearg);
15 Type value;
16 while ( ( value = va_arg (argp, Type) ) > 0.0)
17   continue;
18 va_end (argp);
21 int main (void)
23 double dummy = 0;
24 PrintArgs (dummy, 1.0, 2.0, 3.0, -1.0);
25 return 0;