]> granicus.if.org Git - clang/commitdiff
Simplify. No functionality change.
authorNico Weber <nicolasweber@gmx.de>
Sun, 30 Dec 2012 23:36:56 +0000 (23:36 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sun, 30 Dec 2012 23:36:56 +0000 (23:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171268 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmt.cpp

index 8c33bd6de802328ef55c7ef1e078528af6db33ed..0292de1fdbf00a9542505073075131d7a84c887a 100644 (file)
@@ -867,15 +867,10 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
   SourceLocation CloseLoc = Tok.getLocation();
 
   // We broke out of the while loop because we found a '}' or EOF.
-  if (Tok.isNot(tok::r_brace)) {
-    Diag(Tok, diag::err_expected_rbrace);
-    Diag(T.getOpenLocation(), diag::note_matching) << "{";
+  if (!T.consumeClose())
     // Recover by creating a compound statement with what we parsed so far,
     // instead of dropping everything and returning StmtError();
-  } else {
-    if (!T.consumeClose())
-      CloseLoc = T.getCloseLocation();
-  }
+    CloseLoc = T.getCloseLocation();
 
   return Actions.ActOnCompoundStmt(T.getOpenLocation(), CloseLoc,
                                    Stmts, isStmtExpr);