diff options
| author | Flex Ferrum <[email protected]> | 2012-02-19 16:33:25 +0400 |
|---|---|---|
| committer | Roberto Raggi <[email protected]> | 2012-02-21 15:27:00 +0100 |
| commit | da2aa0df72250811acbb6af51abc961b38bed77a (patch) | |
| tree | 696c211293b82b7cb470f13899dc85d0da83d708 /src/libs/cplusplus/FindUsages.cpp | |
| parent | 7f943caedbc583d73a7218d1f922a3e8afd2c0b4 (diff) | |
C++: Add support for C++11 range-based 'for' loops
Change-Id: I7eef048a7952a79f031ae3d0abba68e3c5ffbfb8
Reviewed-by: Roberto Raggi <[email protected]>
Diffstat (limited to 'src/libs/cplusplus/FindUsages.cpp')
| -rw-r--r-- | src/libs/cplusplus/FindUsages.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 27d02b2b677..cd0d93bbaf6 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -1050,6 +1050,23 @@ bool FindUsages::visit(ForeachStatementAST *ast) return false; } +bool FindUsages::visit(RangeBasedForStatementAST *ast) +{ + Scope *previousScope = switchScope(ast->symbol); + for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) { + this->specifier(it->value); + } + this->declarator(ast->declarator); + this->expression(ast->initializer); + // unsigned comma_token = ast->comma_token; + this->expression(ast->expression); + // unsigned rparen_token = ast->rparen_token; + this->statement(ast->statement); + // Block *symbol = ast->symbol; + (void) switchScope(previousScope); + return false; +} + bool FindUsages::visit(ForStatementAST *ast) { // unsigned for_token = ast->for_token; @@ -2215,5 +2232,3 @@ bool FindUsages::visit(ArrayDeclaratorAST *ast) // unsigned rbracket_token = ast->rbracket_token; return false; } - - |
