diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-12-30 23:36:56 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-12-30 23:36:56 +0000 |
commit | d11f4355a77ab1f8897847d9a458b9f2447d44a4 (patch) | |
tree | 783e84448dcfa039a67a11af5a77c0ede17940b1 /lib/Parse/ParseStmt.cpp | |
parent | 87b8127c2c65c8229e5b874c10a33f1ce13493ad (diff) |
Simplify. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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); |