Commit ccf32449 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Check only NameId and TemplateNameId

parent f87236de
......@@ -170,13 +170,30 @@ bool FindUsages::compareFullyQualifiedName(const QList<const Name *> &path, cons
return false;
for (int i = 0; i < path.length(); ++i) {
if (! path.at(i)->isEqualTo(other.at(i)))
if (! compareName(path.at(i), other.at(i)))
return false;
}
return true;
}
bool FindUsages::compareName(const Name *name, const Name *other)
{
if (name == other)
return true;
else if (name && other) {
const Identifier *id = name->identifier();
const Identifier *otherId = other->identifier();
if (id == otherId || (id && id->isEqualTo(otherId)))
return true;
}
return false;
}
bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const
{
for (int i = candidates.size() - 1; i != -1; --i) {
......
......@@ -106,6 +106,7 @@ protected:
unsigned startOfTemplateDeclaration(TemplateDeclarationAST *ast) const;
static bool compareFullyQualifiedName(const QList<const Name *> &path, const QList<const Name *> &other);
static bool compareName(const Name *name, const Name *other);
private:
const Identifier *_id;
......
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