summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/LookupContext.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-08-12 12:34:23 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2010-08-12 12:34:23 +0200
commitb2baaee4b620b50e10a2098f366148d980c3c5ca (patch)
treebe76a89ffe34783b26f098eab6575be3a2d249e7 /src/libs/cplusplus/LookupContext.cpp
parentefb600665d3cb277d330974bcfd90a1da8dc6395 (diff)
downloadqt-creator-b2baaee4b620b50e10a2098f366148d980c3c5ca.tar.gz
Search for symbols in the template prototype.
Diffstat (limited to 'src/libs/cplusplus/LookupContext.cpp')
-rw-r--r--src/libs/cplusplus/LookupContext.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index 3221c5dd19..e788c529d7 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -283,12 +283,6 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
} else if (Function *fun = scope->asFunction()) {
bindings()->lookupInScope(name, fun, &candidates, /*templateId = */ 0, /*binding=*/ 0);
- // ### port me
-#if 0
- for (TemplateParameters *it = fun->templateParameters(); it && candidates.isEmpty(); it = it->previous())
- bindings()->lookupInScope(name, it->scope(), &candidates, /* templateId = */ 0, /*binding=*/ 0);
-#endif
-
if (! candidates.isEmpty())
break; // it's an argument or a template parameter.
@@ -309,15 +303,13 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
if (! candidates.isEmpty())
break; // it's a formal argument.
- } else if (Class *klass = scope->asClass()) {
- // ### port me
-#if 0
- for (TemplateParameters *it = klass->templateParameters(); it && candidates.isEmpty(); it = it->previous())
- bindings()->lookupInScope(name, it->scope(), &candidates, /* templateId = */ 0, /*binding=*/ 0);
-#endif
+ } else if (Template *templ = scope->asTemplate()) {
+ bindings()->lookupInScope(name, templ, &candidates, /*templateId = */ 0, /*binding=*/ 0);
if (! candidates.isEmpty())
- break; // it's an argument or a template parameter.
+ return candidates; // it's a template parameter.
+
+ } else if (Class *klass = scope->asClass()) {
if (ClassOrNamespace *binding = bindings()->lookupType(klass)) {
candidates = binding->find(name);