[clang] [Clang] fix missing source location for errors in macro-expanded (PR #143460)
Oleksandr T. via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 13 05:05:13 PDT 2025
================
@@ -832,10 +832,13 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx,
<< "'case'" << tok::colon
<< FixItHint::CreateReplacement(ColonLoc, ":");
} else {
- SourceLocation ExpectedLoc = PP.getLocForEndOfToken(PrevTokLocation);
+ SourceLocation ExpectedLoc = getEndOfPreviousToken();
+
Diag(ExpectedLoc, diag::err_expected_after)
<< "'case'" << tok::colon
- << FixItHint::CreateInsertion(ExpectedLoc, ":");
+ << FixItHint::CreateInsertion(ExpectedLoc,
+ tok::getTokenName(tok::colon));
----------------
a-tarasyuk wrote:
@rkirsling I’ll check and fit it today. Thanks
https://github.com/llvm/llvm-project/pull/143460
More information about the cfe-commits
mailing list