summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/LookupContext.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-02-12 17:36:29 +0100
committerEike Ziller <eike.ziller@theqtcompany.com>2015-02-12 17:36:29 +0100
commit56aadc407d7becadec794e660ae7d7c20e820e0c (patch)
treec9aad23933bc6b0c68406e64e359f57143ef54d8 /src/libs/cplusplus/LookupContext.cpp
parent9926fc2ab12ccaa02b7f03b416c54cd58ef30b31 (diff)
parent28971701fd4baa99f294d9393650b83c40754e18 (diff)
downloadqt-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.cpp11
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);