forked from qt-creator/qt-creator
C++11: handle noexcept specifications.
Change-Id: I7da3affea2758b2e01124105e2521e1f2c5f6678 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
10
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
10
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user