Don't check the compound statement terminator when parsing.

The check should be done in the semantic phase.
This commit is contained in:
Roberto Raggi
2010-03-23 10:24:37 +01:00
parent 6f80219d3e
commit 464f797f2f

View File

@@ -3576,14 +3576,6 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
ast->statement = statement->asCompoundStatement();
match(T_RPAREN, &ast->rparen_token);
node = ast;
if (ast->statement && ast->statement->statement_list) {
// check that the last statement is an expression-statement
StatementAST *lastStmt = ast->statement->statement_list->lastValue();
if (!lastStmt || ! ast->asExpressionStatement())
_translationUnit->error(cursor(),
"expected an expression statement before token `%s'",
tok().spell());
}
return true;
} else {
return parseNestedExpression(node);