forked from qt-creator/qt-creator
C++: Improve lookup - collect more valid items
There was a fix for QTCREATORBUG-7730 in the case of nested
forward declarations in commit 74a458bca0.
However, it introduced regressions and actually didn't solve
the issue, since the behavior was hidden by another error fixed later.
The patch should properly fix the issue and the regression pointed
in QTCREATORBUG-7777.
Task-number: QTCREATORBUG-7730
Task-number: QTCREATORBUG-7777
Change-Id: I27397fefdc7cc9a60111761df1f76a01407886f7
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -212,35 +212,6 @@ void FindUsages::reportResult(unsigned tokenIndex)
|
||||
_references.append(tokenIndex);
|
||||
}
|
||||
|
||||
bool FindUsages::compareFullyQualifiedName(const QList<const Name *> &path, const QList<const Name *> &other)
|
||||
{
|
||||
if (path.length() != other.length())
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < path.length(); ++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::isLocalScope(Scope *scope)
|
||||
{
|
||||
if (scope) {
|
||||
|
||||
Reference in New Issue
Block a user