[clang] [Clang] use colon char instead of token name (PR #144068)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 13 05:52:45 PDT 2025


https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/144068

Fixes regression of https://github.com/llvm/llvm-project/pull/143460/files#r2144925614

>From a83afe5aca4f192f378ef4b99477103b23991026 Mon Sep 17 00:00:00 2001
From: Oleksandr Tarasiuk <oleksandr.tarasiuk at outlook.com>
Date: Fri, 13 Jun 2025 15:28:20 +0300
Subject: [PATCH] [Clang] use colon char instead of token name

---
 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 c00759893b0c4..eb761c3b90523 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