Aaron Ballman 5af5fb0555 [C2y] Claim conformance to WG14 N3482
This paper makes it a constraint violation (instead of UB) to call
va_start from a function with a fixed (non-variadic) parameter list.
This is something Clang has always diagnosed as an error.
2025-03-13 13:59:17 -04:00

16 lines
417 B
C

// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -ffreestanding %s
/* WG14 N3482: Yes
* Slay Some Earthly Demons XVII
*
* This paper makes it a constraint violation to call va_start in a non-
* variadic function. This is something Clang has always diagnosed.
*/
#include <stdarg.h>
void func(int a) {
va_list list;
va_start(list, a); // expected-error {{'va_start' used in function with fixed args}}
}