From: Nico Weber Date: Sun, 30 Dec 2012 23:36:56 +0000 (+0000) Subject: Simplify. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d11f4355a77ab1f8897847d9a458b9f2447d44a4;p=clang Simplify. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171268 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 8c33bd6de8..0292de1fdb 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -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);