1 /* { dg-do compile } */
9 va_start (vp
, a
); // { dg-error "used in function with fixed args" }
12 #pragma GCC diagnostic push
13 #pragma GCC diagnostic ignored "-Wvarargs"
16 foo0 (int a
, int b
, ...)
19 /* 'a' is not the last argument of the enclosing function, but
20 don't warn because we are ignoring -Wvarargs. */
26 foo1 (int a
, register int b
, ...)
29 /* 'b' is declared with register storage, but don't warn
30 because we are ignoring -Wvarargs. */
35 #pragma GCC diagnostic pop
38 foo2 (int a
, int b
, ...)
41 /* 'a' is not the last argument of the enclosing function, so
43 va_start (vp
, a
); /* { dg-warning "second parameter" } */
48 foo3 (int a
, register int b
, ...)
51 /* 'b' is declared with register storage, so warn. */
52 va_start (vp
, b
); /* { dg-warning "undefined behaviour" } */