[clang] [clang][Preprocessor] Improve error message for comma in #if and #embed (PR #246129)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 25 15:56:08 PST 2026
================
@@ -961,7 +961,11 @@ Preprocessor::EvaluateDirectiveExpression(IdentifierLoc &IfNDefMacro,
// If we aren't at the tok::eod token, something bad happened, like an extra
// ')' token.
if (Tok.isNot(tok::eod)) {
- Diag(Tok, diag::err_pp_expected_eol);
+ // A top-level comma is left unconsumed because the controlling expression
----------------
Endilll wrote:
There might be no contradiction here, but I'm still confused by this comment. Maybe move it to the code where comma could've been plausibly consumed, and explain that is was left unconsumed for this check?
https://github.com/llvm/llvm-project/pull/246129
More information about the cfe-commits
mailing list