summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-07 15:23:11 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-07 15:23:11 +0000
commit45d6bdfa88d57a6eb25800f4ee9f68feaf7d0902 (patch)
treec98abbbf321467b3cb835ef6a6a2005efc14b0aa /clang/lib/Parse/ParseStmt.cpp
parentce66d028771d0ed37d3eba8c83e9193734b7cf06 (diff)
downloadbcm5719-llvm-45d6bdfa88d57a6eb25800f4ee9f68feaf7d0902.tar.gz
bcm5719-llvm-45d6bdfa88d57a6eb25800f4ee9f68feaf7d0902.zip
Improve recovery when there is a stray ']' or ')' before the ';' at
the end of a statement. Fixes <rdar://problem/6896493>. llvm-svn: 113202
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 6c240e608c2..3ff940faf9d 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -137,7 +137,7 @@ Parser::ParseStatementOrDeclaration(bool OnlyStatement) {
return StmtError();
}
// Otherwise, eat the semicolon.
- ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
+ ExpectAndConsumeSemi(diag::err_expected_semi_after_expr);
return Actions.ActOnExprStmt(Actions.MakeFullExpr(Expr.get()));
}
@@ -507,7 +507,7 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
// FIXME: Use attributes?
// Eat the semicolon at the end of stmt and convert the expr into a
// statement.
- ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
+ ExpectAndConsumeSemi(diag::err_expected_semi_after_expr);
R = Actions.ActOnExprStmt(Actions.MakeFullExpr(Res.get()));
}
}
OpenPOWER on IntegriCloud