diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-05-17 15:08:10 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-05-18 09:24:04 +0200 |
commit | 5cb42c93ef714ae1b15f2ed336371b6d50870532 (patch) | |
tree | 9231cc9d43698d2c9f8754a9a72c1326cc94d534 /src/libs/cplusplus/LookupContext.cpp | |
parent | 38f6379f3949779963b90c904e02314c8f2eaa50 (diff) | |
download | qt-creator-5cb42c93ef714ae1b15f2ed336371b6d50870532.tar.gz |
Instantiate the template functions.
Diffstat (limited to 'src/libs/cplusplus/LookupContext.cpp')
-rw-r--r-- | src/libs/cplusplus/LookupContext.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index f23737c207..879c27de7f 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -391,34 +391,28 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope, else if (s->name()->isQualifiedNameId()) 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; oo.setShowFunctionSignatures(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) - << oo(ty); - -#if 0 - if (Declaration *decl = s->asDeclaration()) { - qDebug() << "instantiate declaration"; - Declaration *d = _control->newDeclaration(0, 0); - d->copy(decl); - d->setType(ty); - result->append(d); - continue; - } else if (Function *fun = s->asFunction()) { - qDebug() << "instantiate function"; - Function *d = ty->asFunctionType(); - d->copy(fun); - result->append(d); - continue; - } -#endif + if (Declaration *decl = s->asDeclaration()) { + Declaration *d = _control->newDeclaration(0, 0); + d->copy(decl); + d->setType(ty); + result->append(d); + continue; + } else if (Function *fun = s->asFunction()) { + Function *d = ty->asFunctionType(); + d->copy(fun); + result->append(d); + continue; } } |