diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-23 12:11:33 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-23 12:12:07 +0100 |
commit | 4b8d59719624271c1e70ba93294016fb593601f5 (patch) | |
tree | 6f8cf60ee992f620bffe561138a5f61e9f37fefd /src/shared/cplusplus/Parser.cpp | |
parent | 21c13328d3c5cf902734045394aa0a976aaf8db2 (diff) | |
download | qt-creator-4b8d59719624271c1e70ba93294016fb593601f5.tar.gz |
Recognize C++0x rvalue references.
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r-- | src/shared/cplusplus/Parser.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index 7d31b66583..32b18dbec9 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -197,6 +197,7 @@ Parser::Parser(TranslationUnit *unit) _tokenIndex(1), _templateArguments(0), _qtMocRunEnabled(false), + _cxx0xEnabled(true), // C++0x is enabled by default _objCEnabled(false), _inFunctionBody(false), _inObjCImplementationContext(false), @@ -213,6 +214,12 @@ bool Parser::qtMocRunEnabled() const void Parser::setQtMocRunEnabled(bool onoff) { _qtMocRunEnabled = onoff; } +bool Parser::cxx0xEnabled() const +{ return _cxx0xEnabled; } + +void Parser::isCxxOxEnabled(bool onoff) +{ _cxx0xEnabled = onoff; } + bool Parser::objCEnabled() const { return _objCEnabled; } @@ -1070,9 +1077,9 @@ bool Parser::parseCvQualifiers(SpecifierListAST *&node) bool Parser::parsePtrOperator(PtrOperatorListAST *&node) { DEBUG_THIS_RULE(); - if (LA() == T_AMPER) { + if (LA() == T_AMPER || (_cxx0xEnabled && LA() == T_AMPER_AMPER)) { ReferenceAST *ast = new (_pool) ReferenceAST; - ast->amp_token = consumeToken(); + ast->reference_token = consumeToken(); node = new (_pool) PtrOperatorListAST(ast); return true; } else if (LA() == T_STAR) { |