Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Return invalid statement results on error.

  • Loading branch information...
commit 601557cc1f19c9cdf0677d78c89b5cebd0299e8c 1 parent 9a37167
Bill Wendling authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/Parse/Parser.cpp
View
12 lib/Parse/Parser.cpp
@@ -833,12 +833,12 @@ Parser::StmtResult Parser::ParseIMPLICITStmt() {
DeclSpec DS;
if (ParseDeclarationTypeSpec(DS))
- return true;
+ return StmtResult();
if (!EatIfPresent(tok::l_paren)) {
Diag.ReportError(Tok.getLocation(),
"expected '(' in IMPLICIT statement");
- return StmtResult();
+ return StmtResult(true);
}
SmallVector<std::pair<const IdentifierInfo*,
@@ -848,7 +848,7 @@ Parser::StmtResult Parser::ParseIMPLICITStmt() {
if (Tok.isNot(tok::identifier) || First->getName().size() > 1) {
Diag.ReportError(Tok.getLocation(),
"expected a letter");
- return StmtResult();
+ return StmtResult(true);
}
Lex();
@@ -859,7 +859,7 @@ Parser::StmtResult Parser::ParseIMPLICITStmt() {
if (Tok.isNot(tok::identifier) || Second->getName().size() > 1) {
Diag.ReportError(Tok.getLocation(),
"expected a letter");
- return StmtResult();
+ return StmtResult(true);
}
Lex();
@@ -868,9 +868,11 @@ Parser::StmtResult Parser::ParseIMPLICITStmt() {
LetterSpecs.push_back(std::make_pair(First, Second));
} while (EatIfPresent(tok::comma));
- if (!EatIfPresent(tok::r_paren))
+ if (!EatIfPresent(tok::r_paren)) {
Diag.ReportError(Tok.getLocation(),
"expected ')' in IMPLICIT statement");
+ return StmtResult(true);
+ }
return Actions.ActOnIMPLICIT(Context, Loc, DS, LetterSpecs, StmtLabel);
}
Please sign in to comment.
Something went wrong with that request. Please try again.