forked from qt-creator/qt-creator
C++: Improve completion when forward declarations present
This fixes one of the issues mentioned in the report below. THe other part will come in a separate patch. Task-number: QTCREATORBUG-7730 Change-Id: I9f56a9bcec8a881dab3ab60f40c5b71f296466da Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -416,6 +416,8 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI
|
||||
QList<LookupItem> result;
|
||||
|
||||
if (name) {
|
||||
QSet<ClassOrNamespace *> processed;
|
||||
|
||||
if (const QualifiedNameId *q = name->asQualifiedNameId()) {
|
||||
if (! q->base())
|
||||
result = globalNamespace()->find(q->name());
|
||||
@@ -423,10 +425,11 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI
|
||||
else if (ClassOrNamespace *binding = lookupType(q->base()))
|
||||
result = binding->find(q->name());
|
||||
|
||||
lookup_helper(name, this, &result, &processed, /*templateId = */ 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QSet<ClassOrNamespace *> processed;
|
||||
ClassOrNamespace *binding = this;
|
||||
do {
|
||||
lookup_helper(name, binding, &result, &processed, /*templateId = */ 0);
|
||||
|
||||
Reference in New Issue
Block a user