C++11: first set of changes for decltype.

Change-Id: I49d6ff7eb1805cd07bdfcb27bb37d4c6cadc9115
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Erik Verbruggen
2012-02-10 14:41:58 +01:00
parent 07d335b215
commit 3f5dc36a53
20 changed files with 181 additions and 3 deletions

View File

@@ -3483,6 +3483,7 @@ bool Parser::lookAtBuiltinTypeSpecifier() const
case T_DOUBLE:
case T_VOID:
case T_AUTO:
case T_DECLTYPE:
return true;
// [gcc] extensions
case T___TYPEOF__:
@@ -3579,6 +3580,17 @@ bool Parser::parseBuiltinTypeSpecifier(SpecifierListAST *&node)
parseUnaryExpression(ast->expression);
node = new (_pool) SpecifierListAST(ast);
return true;
} else if (LA() == T_DECLTYPE) {
DecltypeSpecifierAST *ast = new (_pool) DecltypeSpecifierAST;
ast->decltype_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
if (parseExpression(ast->expression)) {
match(T_RPAREN, &ast->rparen_token);
node = new (_pool) SpecifierListAST(ast);
return true;
}
skipUntilDeclaration();
return true;
} else if (lookAtBuiltinTypeSpecifier()) {
SimpleSpecifierAST *ast = new (_pool) SimpleSpecifierAST;
ast->specifier_token = consumeToken();