Commit b880ace1 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

C++: Minor cleanup



Save a few as* calls

Change-Id: Id2aa43a39ead7231d9e9046ad16d51c05af1ec77
Reviewed-by: default avatarPrzemyslaw Gorszkowski <pgorszkowski@gmail.com>
parent fa6d623d
......@@ -964,13 +964,16 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
}
// instantiate function template
if (name->isTemplateNameId() && s->isTemplate() && s->asTemplate()->declaration()
&& s->asTemplate()->declaration()->isFunction()) {
const TemplateNameId *instantiation = name->asTemplateNameId();
Template *specialization = s->asTemplate();
Symbol *instantiatedFunctionTemplate = instantiateTemplateFunction(instantiation,
specialization);
item.setType(instantiatedFunctionTemplate->type()); // override the type.
if (const TemplateNameId *instantiation = name->asTemplateNameId()) {
if (Template *specialization = s->asTemplate()) {
if (const Symbol *decl = specialization->declaration()) {
if (decl->isFunction()) {
Symbol *instantiatedFunctionTemplate =
instantiateTemplateFunction(instantiation, specialization);
item.setType(instantiatedFunctionTemplate->type()); // override the type
}
}
}
}
result->append(item);
......
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