[clang] [Clang] Fix fix-it hint regression from #143460 (PR #144069)

Ross Kirsling via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 13 05:53:13 PDT 2025


https://github.com/rkirsling created https://github.com/llvm/llvm-project/pull/144069

Following #143460, `:` began displaying as `colon` in the fix-it hint for a `case` with a missing colon, as is visible in the description of (the separate bug) #144052.

This PR simply reverts a line that didn't need to be changed.

>From be121c500684e971ad696be8d53db732665d851c Mon Sep 17 00:00:00 2001
From: Ross Kirsling <ross.kirsling at sony.com>
Date: Fri, 13 Jun 2025 21:51:25 +0900
Subject: [PATCH] [Clang] Fix fix-it hint regression from #143460

`:` began displaying as `colon` in the fix-it hint for a `case` with a missing colon.
---
 clang/lib/Parse/ParseStmt.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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



More information about the cfe-commits mailing list