diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-08-19 13:10:36 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-08-19 14:24:05 +0200 |
commit | d8c053b5254ea557b51c3b62be68d4a6752a79df (patch) | |
tree | c86c8750ad791e2e37079de0d7ed20ddc0b91670 /src/libs/cplusplus/ResolveExpression.cpp | |
parent | f51511a81d82eea9e02351b8a97bbc4111793d8b (diff) | |
download | qt-creator-d8c053b5254ea557b51c3b62be68d4a6752a79df.tar.gz |
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>
Diffstat (limited to 'src/libs/cplusplus/ResolveExpression.cpp')
-rw-r--r-- | src/libs/cplusplus/ResolveExpression.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index aba01829ef..8fe431d5e6 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -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; + } + } + } } } } |