Recognize C++0x rvalue references.

This commit is contained in:
Roberto Raggi
2010-03-23 12:11:33 +01:00
parent 21c13328d3
commit 4b8d597196
13 changed files with 46 additions and 20 deletions

View File

@@ -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) {