diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 08c54b19a9d79b667fee0ef694c30b330808c5de..dec887712849d7df2d6c552360db097b23621ea7 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -176,7 +176,7 @@ QList<Symbol *> LookupContext::resolve(Name *name, const QList<Scope *> &visible scopes.clear(); foreach (Symbol *candidate, candidates) { if (ScopedSymbol *scoped = candidate->asScopedSymbol()) { - scopes.append(scoped->members()); + expand(scoped->members(), visibleScopes, &scopes); } } } @@ -223,9 +223,14 @@ QList<Symbol *> LookupContext::resolve(Name *name, const QList<Scope *> &visible continue; if (q->nameCount() > 1) { - Name *classOrNamespaceName = - control()->qualifiedNameId(q->names(), - q->nameCount() - 1); + Name *classOrNamespaceName = 0; + + if (q->nameCount() == 1) + classOrNamespaceName = q->nameAt(0); + else + classOrNamespaceName = control()->qualifiedNameId(q->names(), + q->nameCount() - 1); + const QList<Symbol *> resolvedClassOrNamespace = resolveClassOrNamespace(classOrNamespaceName, visibleScopes);