-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Clang] use colon char instead of token name #144068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-clang Author: Oleksandr T. (a-tarasyuk) ChangesFixes regression of https://github.com/llvm/llvm-project/pull/143460/files#r2144925614 Full diff: https://github.com/llvm/llvm-project/pull/144068.diff 1 Files Affected:
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;
}
|
|
/cc @rkirsling |
Fznamznon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test?
|
Ohh, you beat me by a minute. 😆 I suppose #144069 could be closed then. |
AaronBallman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one also LGTM, I don't have a strong preference for this PR or the other one. :-)
@rkirsling You can copy the tests/changes from this PR into yours — I'll close this one. |
|
I believe I'd need somebody to hit the merge button for me regardless, so I think we can just merge whichever one and close the other. 😅 The two approaches are mostly the same, I just figured that the surrounding code was consistent in using a literal Either way, sorry to cause a run-around! |
|
@rkirsling, this test does not verify the fix https://github.com/llvm/llvm-project/pull/144069/files#diff-b87b117875d2e75dc1ef39535756591a688853bbeb7f83e5b4df6bafca111fa0R239-R241 switch-recovery.cpp doesn't use FileCheck |
|
Oh oops! Thanks for the correction. Edit: Fixed now. |
Fixes regression of https://github.com/llvm/llvm-project/pull/143460/files#r2144925614