diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-02-12 17:36:29 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-02-12 17:36:29 +0100 |
commit | 56aadc407d7becadec794e660ae7d7c20e820e0c (patch) | |
tree | c9aad23933bc6b0c68406e64e359f57143ef54d8 /src/libs/cplusplus/LookupContext.cpp | |
parent | 9926fc2ab12ccaa02b7f03b416c54cd58ef30b31 (diff) | |
parent | 28971701fd4baa99f294d9393650b83c40754e18 (diff) | |
download | qt-creator-56aadc407d7becadec794e660ae7d7c20e820e0c.tar.gz |
Merge remote-tracking branch 'origin/3.3'
Conflicts:
src/plugins/debugger/watchhandler.cpp
src/plugins/projectexplorer/kitmodel.cpp
src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
src/shared/qbs
Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
Diffstat (limited to 'src/libs/cplusplus/LookupContext.cpp')
-rw-r--r-- | src/libs/cplusplus/LookupContext.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 862ff1850e..a844414fc0 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -631,10 +631,15 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI // a qualified name. For instance, a nested class which is forward declared // in the class but defined outside it - we should capture both. Symbol *match = 0; + QSet<ClassOrNamespace *> processed; for (ClassOrNamespace *parentBinding = binding->parent(); parentBinding && !match; - parentBinding = parentBinding->parent()) + parentBinding = parentBinding->parent()) { + if (processed.contains(parentBinding)) + break; + processed.insert(parentBinding); match = parentBinding->lookupInScope(fullName); + } if (match) { LookupItem item; @@ -648,8 +653,12 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI } QSet<ClassOrNamespace *> processed; + QSet<ClassOrNamespace *> processedOwnParents; ClassOrNamespace *binding = this; do { + if (processedOwnParents.contains(binding)) + break; + processedOwnParents.insert(binding); lookup_helper(name, binding, &result, &processed, /*templateId = */ 0); binding = binding->_parent; } while (searchInEnclosingScope && binding); |