[clang] [Clang] fix missing source location for ':' error in macro-expanded case statements (PR #143460)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 10 06:20:58 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- clang/lib/Parse/ParseStmt.cpp clang/test/Parser/switch-recovery.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index c23a59618..87472fd6f 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -840,7 +840,8 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx,
 
       Diag(ExpectedLoc, diag::err_expected_after)
           << "'case'" << tok::colon
-          << FixItHint::CreateInsertion(ExpectedLoc, tok::getTokenName(tok::colon));
+          << FixItHint::CreateInsertion(ExpectedLoc,
+                                        tok::getTokenName(tok::colon));
 
       ColonLoc = ExpectedLoc;
     }

``````````

</details>


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


More information about the cfe-commits mailing list