diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 40dd61b2c538da033e850ffd041c710540570876..4991efa806493605259b84676926af0e2c7e5774 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -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) { diff --git a/src/libs/cplusplus/FindUsages.h b/src/libs/cplusplus/FindUsages.h index 05a71e9e966dbf42d57e524fba813baac02d5fa3..a10e1ac4829c5239239901827796b5cb5ba458e4 100644 --- a/src/libs/cplusplus/FindUsages.h +++ b/src/libs/cplusplus/FindUsages.h @@ -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;