Fix invalid decltype error recovery which resulted in crashes.

Task-number: QTCREATORBUG-7174

Change-Id: I653db71adc45586cd8518ffd96118425fd3763be
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Erik Verbruggen
2012-03-28 13:34:31 +02:00
parent 0f21515277
commit 275e207d26
2 changed files with 10 additions and 4 deletions

View File

@@ -3638,11 +3638,9 @@ bool Parser::parseBuiltinTypeSpecifier(SpecifierListAST *&node)
DecltypeSpecifierAST *ast = new (_pool) DecltypeSpecifierAST;
ast->decltype_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
if (parseExpression(ast->expression)) {
if (parseExpression(ast->expression))
match(T_RPAREN, &ast->rparen_token);
node = new (_pool) SpecifierListAST(ast);
return true;
}
node = new (_pool) SpecifierListAST(ast);
skipUntilDeclaration();
return true;
} else if (lookAtBuiltinTypeSpecifier()) {