================
@@ -4864,14 +4877,22 @@ bool Sema::BuiltinVAStart(unsigned BuiltinID, CallExpr 
*TheCall) {
     return true;
 
   // Verify that the second argument to the builtin is the last argument of the
-  // current function or method. In C23 mode, if the second argument is an
-  // integer constant expression with value 0, then we don't bother with this
-  // check.
+  // current function or method. In C23 mode and the call is not to
+  // __builtin_c23_va_start, if the second argument is an integer constant
+  // expression with value 0, then we don't bother with this check. For
+  // __builtin_c23_va_start, we only perform the check for the second argument
+  // being the last argument to the current function if there is a second
+  // argument present.
+  if (BuiltinID == Builtin::BI__builtin_c23_va_start &&
+      TheCall->getNumArgs() < 2)
+    return false;
+
   bool SecondArgIsLastNamedArgument = false;
----------------
erichkeane wrote:

Why is this so 'high'?  Shouldn't this be down near 4903 (new numbers).

https://github.com/llvm/llvm-project/pull/131166
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to