diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 3221c5dd19d..e788c529d75 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -283,12 +283,6 @@ QList 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 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);