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:
Leandro Melo
2012-08-22 14:44:53 +02:00
parent b53d562816
commit 74a458bca0
3 changed files with 39 additions and 1 deletions

View File

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