Commit b2baaee4 authored by Roberto Raggi's avatar Roberto Raggi

Search for symbols in the template prototype.

parent efb60066
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment