Commit 5cb42c93 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Instantiate the template functions.

parent 38f6379f
...@@ -391,34 +391,28 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope, ...@@ -391,34 +391,28 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
else if (s->name()->isQualifiedNameId()) else if (s->name()->isQualifiedNameId())
continue; // skip qualified ids. continue; // skip qualified ids.
if (debug) { if (templateId && (s->isDeclaration() || s->isFunction())) {
if (templateId && (s->isDeclaration() || s->isFunction())) {
FullySpecifiedType ty = GenTemplateInstance::instantiate(templateId, s, _control); FullySpecifiedType ty = GenTemplateInstance::instantiate(templateId, s, _control);
if (debug) {
Overview oo; Overview oo;
oo.setShowFunctionSignatures(true); oo.setShowFunctionSignatures(true);
oo.setShowReturnTypes(true); oo.setShowReturnTypes(true);
qDebug() << "instantiate:" << oo(s->type(), s->name()) << "using:" << oo(templateId) << oo(ty);
}
qDebug() << "TODO: instantiate:" << oo(s->type(), s->name()) << "using:" << oo(templateId) if (Declaration *decl = s->asDeclaration()) {
<< oo(ty); Declaration *d = _control->newDeclaration(0, 0);
d->copy(decl);
#if 0 d->setType(ty);
if (Declaration *decl = s->asDeclaration()) { result->append(d);
qDebug() << "instantiate declaration"; continue;
Declaration *d = _control->newDeclaration(0, 0); } else if (Function *fun = s->asFunction()) {
d->copy(decl); Function *d = ty->asFunctionType();
d->setType(ty); d->copy(fun);
result->append(d); result->append(d);
continue; continue;
} else if (Function *fun = s->asFunction()) {
qDebug() << "instantiate function";
Function *d = ty->asFunctionType();
d->copy(fun);
result->append(d);
continue;
}
#endif
} }
} }
......
Supports Markdown
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