[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 20 11:13:04 PDT 2024


================
@@ -993,11 +993,18 @@ MacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName,
       // If the macro contains the comma pasting extension, the diagnostic
       // is suppressed; we know we'll get another diagnostic later.
       if (!MI->hasCommaPasting()) {
-        // C++20 allows this construct, but standards before C++20 and all C
-        // standards do not allow the construct (we allow it as an extension).
-        Diag(Tok, getLangOpts().CPlusPlus20
-                      ? diag::warn_cxx17_compat_missing_varargs_arg
-                      : diag::ext_missing_varargs_arg);
+        // C++20 and C23 allow this construct, but standards before that
+        // do not (we allow it as an extension).
----------------
AaronBallman wrote:

I think it's worth adding the standards citation just the same, even if we don't copy the text from the standard. e.g.,
```
// C++20 [cpp.replace]p15, C23 6.10.5p12
```


https://github.com/llvm/llvm-project/pull/84520


More information about the cfe-commits mailing list