From cbf24ab6f4c11b39cdf22f1ff016d3e8697d1678 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 5 Oct 2009 12:36:46 +0200 Subject: [PATCH] Don't look at formal arguments. --- src/plugins/cpptools/cppfindreferences.cpp | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index 852150e7a86..03409b52c90 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -364,6 +364,34 @@ protected: return false; } + virtual bool visit(ParameterDeclarationAST *ast) + { + for (SpecifierAST *spec = ast->type_specifier; spec; spec = spec->next) + accept(spec); + + if (DeclaratorAST *declarator = ast->declarator) { + for (SpecifierAST *attr = declarator->attributes; attr; attr = attr->next) + accept(attr); + + for (PtrOperatorAST *ptr_op = declarator->ptr_operators; ptr_op; ptr_op = ptr_op->next) + accept(ptr_op); + + // ### TODO: well, not exactly. We need to look at qualified-name-ids and nested-declarators. + // accept(declarator->core_declarator); + + for (PostfixDeclaratorAST *fx_op = declarator->postfix_declarators; fx_op; fx_op = fx_op->next) + accept(fx_op); + + for (SpecifierAST *spec = declarator->post_attributes; spec; spec = spec->next) + accept(spec); + + accept(declarator->initializer); + } + + accept(ast->expression); + return false; + } + private: QFutureInterface *_future; Identifier *_id; // ### remove me