diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-23 13:43:18 +0100 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-23 14:13:21 +0100 |
commit | 8b625a867c24a9dd62a3c6c866622284eafd24c7 (patch) | |
tree | 2f5111e000363df9cd2c60ae3c185b9a0fdc54ac /src/shared/cplusplus/Parser.cpp | |
parent | 199d1e14c5bf0e7910baec625ca0f77606c5bb43 (diff) | |
download | qt-creator-8b625a867c24a9dd62a3c6c866622284eafd24c7.tar.gz |
Parse C++0x mem-initializer-list.
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r-- | src/shared/cplusplus/Parser.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp index 32b18dbec9..5e86a4cc02 100644 --- a/src/shared/cplusplus/Parser.cpp +++ b/src/shared/cplusplus/Parser.cpp @@ -2087,6 +2087,10 @@ bool Parser::parseCtorInitializer(CtorInitializerAST *&node) ast->colon_token = colon_token; parseMemInitializerList(ast->member_initializer_list); + + if (_cxx0xEnabled && LA() == T_DOT_DOT_DOT) + ast->dot_dot_dot_token = consumeToken(); + node = ast; return true; } @@ -2243,6 +2247,9 @@ bool Parser::parseMemInitializerList(MemInitializerListAST *&node) if (LA() == T_LBRACE) break; + else if (_cxx0xEnabled && LA() == T_DOT_DOT_DOT && LA(2) == T_LBRACE) + break; + else if (LA() == T_COMMA || (LA() == T_IDENTIFIER && (LA(2) == T_LPAREN || LA(2) == T_COLON_COLON))) { if (LA() != T_COMMA) _translationUnit->error(cursor(), "expected `,'"); @@ -2257,8 +2264,13 @@ bool Parser::parseMemInitializerList(MemInitializerListAST *&node) } else break; } - if (LA() != T_LBRACE) + if (_cxx0xEnabled && LA() == T_DOT_DOT_DOT) { + if (LA(2) != T_LBRACE) + _translationUnit->error(cursor(), "expected `{'"); + + } else if (LA() != T_LBRACE) { _translationUnit->error(cursor(), "expected `{'"); + } return true; } |