C++: Fix completion for typedefs for templates in namespaces.

Change-Id: Ib96551388c94731d97eb8f9728613b120b0b86a9
Reviewed-on: http://codereview.qt.nokia.com/3262
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-19 13:10:36 +02:00
parent f51511a81d
commit d8c053b525
3 changed files with 46 additions and 21 deletions

View File

@@ -712,10 +712,20 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
if (ClassOrNamespace *retBinding = findClass(ptrTy->elementType(), overload->enclosingScope()))
return retBinding;
else if (scope != overload->enclosingScope()) {
if (scope != overload->enclosingScope()) {
if (ClassOrNamespace *retBinding = findClass(ptrTy->elementType(), scope))
return retBinding;
}
if (ClassOrNamespace *origin = binding->instantiationOrigin()) {
foreach (Symbol *originSymbol, origin->symbols()) {
Scope *originScope = originSymbol->asScope();
if (originScope && originScope != scope && originScope != overload->enclosingScope()) {
if (ClassOrNamespace *retBinding = findClass(ptrTy->elementType(), originScope))
return retBinding;
}
}
}
}
}
}