]> granicus.if.org Git - clang/commitdiff
Remove the Fix-it for missing statement in switches
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 14 Jun 2011 15:24:38 +0000 (15:24 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 14 Jun 2011 15:24:38 +0000 (15:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132994 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmt.cpp

index 6b4a0a404584a102ba5b0bed4a2890ce32974bd4..28b34fe89ab22e60252d7c4c603f7cc860296a48 100644 (file)
@@ -589,9 +589,8 @@ StmtResult Parser::ParseCaseStatement(ParsedAttributes &attrs, bool MissingCase,
   } else {
     // Nicely diagnose the common error "switch (X) { case 4: }", which is
     // not valid.
-    SourceLocation ExpectedLoc = PP.getLocForEndOfToken(ColonLoc);
-    Diag(ExpectedLoc, diag::err_label_end_of_compound_statement)
-      << FixItHint::CreateInsertion(ExpectedLoc, ";");
+    SourceLocation AfterColonLoc = PP.getLocForEndOfToken(ColonLoc);
+    Diag(AfterColonLoc, diag::err_label_end_of_compound_statement);
     SubStmt = true;
   }
 
@@ -635,9 +634,8 @@ StmtResult Parser::ParseDefaultStatement(ParsedAttributes &attrs) {
   
   // Diagnose the common error "switch (X) {... default: }", which is not valid.
   if (Tok.is(tok::r_brace)) {
-    SourceLocation ExpectedLoc = PP.getLocForEndOfToken(ColonLoc);
-    Diag(ExpectedLoc, diag::err_label_end_of_compound_statement)
-      << FixItHint::CreateInsertion(ExpectedLoc, ";");
+    SourceLocation AfterColonLoc = PP.getLocForEndOfToken(ColonLoc);
+    Diag(AfterColonLoc, diag::err_label_end_of_compound_statement);
     return StmtError();
   }