diff options
Diffstat (limited to 'clang/test/Sema/varargs.c')
| -rw-r--r-- | clang/test/Sema/varargs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/varargs.c b/clang/test/Sema/varargs.c index 820567777c5..07081edd1d9 100644 --- a/clang/test/Sema/varargs.c +++ b/clang/test/Sema/varargs.c @@ -67,3 +67,12 @@ void f8(int a, ...) { (void)__builtin_va_arg(ap, void); // expected-error {{second argument to 'va_arg' is of incomplete type 'void'}} __builtin_va_end(ap); } + +enum E { x = -1, y = 2, z = 10000 }; +void f9(__builtin_va_list args) +{ + (void)__builtin_va_arg(args, float); // expected-warning {{second argument to 'va_arg' is of promotable type 'float'}} + (void)__builtin_va_arg(args, enum E); // Don't warn here in C + (void)__builtin_va_arg(args, short); // expected-warning {{second argument to 'va_arg' is of promotable type 'short'}} + (void)__builtin_va_arg(args, char); // expected-warning {{second argument to 'va_arg' is of promotable type 'char'}} +} |

