Check only NameId and TemplateNameId

This commit is contained in:
Roberto Raggi
2010-08-05 13:38:27 +02:00
parent f87236de39
commit ccf3244932
2 changed files with 19 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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;