Search for symbols in the template prototype.

This commit is contained in:
Roberto Raggi
2010-08-12 12:34:23 +02:00
parent efb600665d
commit b2baaee4b6

View File

@@ -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);