Skip to content

Commit 475a112

Browse files
committed
Fix tests for new diagnostic wording on main
1 parent 065fa19 commit 475a112

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/test/C/C23/n2975.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef void (*fp)(...); // expected-warning {{'...' as the only parameter of a
3030
// Passing something other than the argument before the ... is still not valid.
3131
void diag(int a, int b, ...) {
3232
va_list list;
33-
va_start(list, a); // expected-warning {{second argument to 'va_start' is not the last named parameter}}
33+
va_start(list, a); // expected-warning {{second argument to 'va_start' is not the last non-variadic parameter}}
3434
// However, the builtin itself is under no such constraints regarding
3535
// expanding or evaluating the second argument, so it can still diagnose.
3636
__builtin_va_start(list, a); // expected-warning {{second argument to 'va_start' is not the last non-variadic parameter}}

clang/test/Sema/c23-varargs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ void foo(int x, int y, ...) {
1010
// Note, the unknown builtin diagnostic is only issued once per function,
1111
// which is why the rest of the lines do not get the same diagonstic.
1212
__builtin_c23_va_start(list); // ok
13-
__builtin_c23_va_start(list, 0); // expected-warning {{second argument to 'va_start' is not the last named parameter}}
14-
__builtin_c23_va_start(list, x); // expected-warning {{second argument to 'va_start' is not the last named parameter}}
13+
__builtin_c23_va_start(list, 0); // expected-warning {{second argument to 'va_start' is not the last non-variadic parameter}}
14+
__builtin_c23_va_start(list, x); // expected-warning {{second argument to 'va_start' is not the last non-variadic parameter}}
1515
__builtin_c23_va_start(list, y); // ok
1616
__builtin_c23_va_start(list, 0, 1); // expected-error {{too many arguments to function call, expected at most 2, have 3}}
1717
__builtin_c23_va_start(list, y, y); // expected-error {{too many arguments to function call, expected at most 2, have 3}}
@@ -30,8 +30,8 @@ void bar(int x, int y, ...) {
3030
expected-error{{too few arguments to function call, expected 1, have 0}}
3131
va_start(list); // pre-c23-error {{too few arguments provided to function-like macro invocation}} \
3232
pre-c23-error {{use of undeclared identifier 'va_start'}}
33-
va_start(list, 0); // both-warning {{second argument to 'va_start' is not the last named parameter}}
34-
va_start(list, x); // both-warning {{second argument to 'va_start' is not the last named parameter}}
33+
va_start(list, 0); // both-warning {{second argument to 'va_start' is not the last non-variadic parameter}}
34+
va_start(list, x); // both-warning {{second argument to 'va_start' is not the last non-variadic parameter}}
3535
va_start(list, y); // ok
3636
va_start(list, 0, 1); // pre-c23-error {{too many arguments provided to function-like macro invocation}} \
3737
pre-c23-error {{use of undeclared identifier 'va_start'}} \

0 commit comments

Comments
 (0)