From 249aaa0ab6d95b025923a1c48ce1359f9832ea0b Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Wed, 25 Mar 2009 12:28:56 +0100
Subject: [PATCH] Fixed the lookup of qualified name ids.

---
 src/libs/cplusplus/LookupContext.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index 08c54b19a9d..dec88771284 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);
-- 
GitLab