diff options
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; + } + } + } } } } |