C++11: handle noexcept specifications.

Change-Id: I7da3affea2758b2e01124105e2521e1f2c5f6678
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Erik Verbruggen
2012-02-02 11:40:01 +01:00
parent a2f9ee870e
commit dd4299073e
18 changed files with 197 additions and 33 deletions

View File

@@ -2313,7 +2313,7 @@ bool Parser::parseExceptionSpecification(ExceptionSpecificationAST *&node)
{
DEBUG_THIS_RULE();
if (LA() == T_THROW) {
ExceptionSpecificationAST *ast = new (_pool) ExceptionSpecificationAST;
DynamicExceptionSpecificationAST *ast = new (_pool) DynamicExceptionSpecificationAST;
ast->throw_token = consumeToken();
if (LA() == T_LPAREN)
ast->lparen_token = consumeToken();
@@ -2325,6 +2325,14 @@ bool Parser::parseExceptionSpecification(ExceptionSpecificationAST *&node)
ast->rparen_token = consumeToken();
node = ast;
return true;
} else if (_cxx0xEnabled && LA() == T_NOEXCEPT) {
NoExceptSpecificationAST *ast = new (_pool) NoExceptSpecificationAST;
ast->noexcept_token = consumeToken();
if (LA() == T_LPAREN && parseConstantExpression(ast->expression)) {
match(T_RPAREN, &ast->rparen_token);
}
node = ast;
return true;
}
return false;
}