Commit 4eb9b5f1 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

C++: Simplify template function resolving a bit



There's no reason to keep the Template after it is instantiated.

Change-Id: I91210ae11b3420bb038168fe951b52d28ccc132e
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent b5f6a9e6
......@@ -2104,7 +2104,7 @@ Symbol *CreateBindings::instantiateTemplateFunction(const TemplateNameId *instan
subst.bind(cloner.name(name, &subst), ty);
}
return cloner.symbol(specialization, &subst);
return cloner.symbol(specialization->declaration(), &subst);
}
} // namespace CPlusPlus
......@@ -679,14 +679,6 @@ bool ResolveExpression::visit(CallAST *ast)
// Constructor call
FullySpecifiedType ctorTy = control()->namedType(classTy->name());
addResult(ctorTy, scope);
} else if (Template *templateTy = ty->asTemplateType()) {
// template function
if (Symbol *declaration = templateTy->declaration()) {
if (Function *funTy = declaration->asFunction()) {
if (maybeValidPrototype(funTy, actualArgumentCount))
addResult(funTy->returnType().simplified(), scope);
}
}
}
}
......
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