Anders Carlsson | 6eda8c9 | 2007-10-12 17:48:41 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | void f1(int a) |
| 4 | { |
| 5 | __builtin_va_list ap; |
| 6 | |
| 7 | __builtin_va_start(ap, a, a); // expected-error {{too many arguments to function}} |
| 8 | __builtin_va_start(ap, a); // expected-error {{'va_start' used in function with fixed args}} |
| 9 | } |
| 10 | |
| 11 | void f2(int a, int b, ...) |
| 12 | { |
| 13 | __builtin_va_list ap; |
| 14 | |
| 15 | __builtin_va_start(ap, 10); // expected-warning {{second parameter of 'va_start' not last named argument}} |
| 16 | __builtin_va_start(ap, a); // expected-warning {{second parameter of 'va_start' not last named argument}} |
| 17 | __builtin_va_start(ap, b); |
| 18 | } |