Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clang/lib/Parse/ParseStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Parser/switch-recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ namespace GH143216 {
int f(int x) {
switch (x) {
case FOO // expected-error {{expected ':' after 'case'}}
// CHECK: {{^}} case FOO
// CHECK: {{^}} ^
// CHECK: {{^}} :
return 0;
default:
return 1;
Expand Down
Loading