[clang] 5af5fb0 - [C2y] Claim conformance to WG14 N3482

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 13 10:59:25 PDT 2025


Author: Aaron Ballman
Date: 2025-03-13T13:59:17-04:00
New Revision: 5af5fb055527f3145af08cf7f1fbacd97701ff36

URL: https://github.com/llvm/llvm-project/commit/5af5fb055527f3145af08cf7f1fbacd97701ff36
DIFF: https://github.com/llvm/llvm-project/commit/5af5fb055527f3145af08cf7f1fbacd97701ff36.diff

LOG: [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.

Added: 
    clang/test/C/C2y/n3482.c

Modified: 
    clang/www/c_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/C/C2y/n3482.c b/clang/test/C/C2y/n3482.c
new file mode 100644
index 0000000000000..9588b751300f1
--- /dev/null
+++ b/clang/test/C/C2y/n3482.c
@@ -0,0 +1,15 @@
+// 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}}
+}

diff  --git a/clang/www/c_status.html b/clang/www/c_status.html
index 6080ed060cfbb..f3f9ffadae7ec 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -308,7 +308,7 @@ <h2 id="c2y">C2y implementation status</h2>
     <tr>
       <td>Slay Some Earthly Demons XVII</td>
       <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3482.pdf">N3482</a></td>
-      <td class="unknown" align="center">Unknown</td>
+      <td class="full" align="center">Yes</td>
 	</tr>
     <tr>
       <td>Clarify the specification of the width macros</td>


        


More information about the cfe-commits mailing list