[clang] [clang] Suggest using __VA_OPT__(,) instead of GNU zero variadic macro argument (PR #188624)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 04:59:42 PDT 2026
================
@@ -523,7 +530,16 @@ void TokenLexer::ExpandFunctionArguments() {
Macro->isVariadic()) {
VaArgsPseudoPaste = true;
// Remove the paste operator, report use of the extension.
- PP.Diag(ResultToks.pop_back_val().getLocation(), diag::ext_paste_comma);
+ const bool VaOptSupport = hasVaOptSupport(PP.getLangOpts());
----------------
AaronBallman wrote:
We don't use top-level const in the project as a whole; generally harmless to use but we rely on `const_cast` in some places to cast away `const` in a number of places and if the original object is declared `const`, that's UB, so there's ever-so-slight risk for top-level `const`. (Someday, I'd love to see our const correctness get to the point where we use top-level const to enforce correctness!)
https://github.com/llvm/llvm-project/pull/188624
More information about the cfe-commits
mailing list