Commit e130c035 authored by Roberto Raggi's avatar Roberto Raggi

Process the names of the formal arguments when searching references in function definitions.

parent 24bcbaef
......@@ -77,7 +77,8 @@ public:
_doc(doc),
_snapshot(snapshot),
_source(_doc->source()),
_sem(doc->control())
_sem(doc->control()),
_inSimpleDeclaration(0)
{
_snapshot.insert(_doc);
}
......@@ -435,8 +436,8 @@ protected:
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);
if (! _inSimpleDeclaration) // visit the core declarator only if we are not in simple-declaration.
accept(declarator->core_declarator);
for (PostfixDeclaratorAST *fx_op = declarator->postfix_declarators; fx_op; fx_op = fx_op->next)
accept(fx_op);
......@@ -469,6 +470,15 @@ protected:
return false;
}
virtual bool visit(SimpleDeclarationAST *)
{
++_inSimpleDeclaration;
return true;
}
virtual void endVisit(SimpleDeclarationAST *)
{ --_inSimpleDeclaration; }
private:
QFutureInterface<Utils::FileSearchResult> *_future;
Identifier *_id; // ### remove me
......@@ -482,6 +492,7 @@ private:
QList<PostfixExpressionAST *> _postfixExpressionStack;
QList<QualifiedNameAST *> _qualifiedNameStack;
QList<int> _references;
int _inSimpleDeclaration;
};
} // end of anonymous namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment