Clarify the difference between substitution and instantiation by renaming
functions that don't instantiate definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80037 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 3a17226..ec198e0 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -967,8 +967,8 @@
for (unsigned I = 0, N = PartialTemplateArgs.flat_size(); I != N; ++I) {
Decl *Param = const_cast<Decl *>(
ClassTemplate->getTemplateParameters()->getParam(I));
- TemplateArgument InstArg = Instantiate(PartialTemplateArgs[I],
- *DeducedArgumentList);
+ TemplateArgument InstArg = Subst(PartialTemplateArgs[I],
+ *DeducedArgumentList);
if (InstArg.isNull()) {
Info.Param = makeTemplateParameter(Param);
Info.FirstArg = PartialTemplateArgs[I];
@@ -1118,10 +1118,10 @@
PEnd = Function->param_end();
P != PEnd;
++P) {
- QualType ParamType = InstantiateType((*P)->getType(),
- *ExplicitArgumentList,
- (*P)->getLocation(),
- (*P)->getDeclName());
+ QualType ParamType = SubstType((*P)->getType(),
+ *ExplicitArgumentList,
+ (*P)->getLocation(),
+ (*P)->getDeclName());
if (ParamType.isNull() || Trap.hasErrorOccurred())
return TDK_SubstitutionFailure;
@@ -1136,10 +1136,10 @@
= Function->getType()->getAsFunctionProtoType();
assert(Proto && "Function template does not have a prototype?");
- QualType ResultType = InstantiateType(Proto->getResultType(),
- *ExplicitArgumentList,
- Function->getTypeSpecStartLoc(),
- Function->getDeclName());
+ QualType ResultType = SubstType(Proto->getResultType(),
+ *ExplicitArgumentList,
+ Function->getTypeSpecStartLoc(),
+ Function->getDeclName());
if (ResultType.isNull() || Trap.hasErrorOccurred())
return TDK_SubstitutionFailure;
@@ -1213,9 +1213,9 @@
// Substitute the deduced template arguments into the function template
// declaration to produce the function template specialization.
Specialization = cast_or_null<FunctionDecl>(
- InstantiateDecl(FunctionTemplate->getTemplatedDecl(),
- FunctionTemplate->getDeclContext(),
- *DeducedArgumentList));
+ SubstDecl(FunctionTemplate->getTemplatedDecl(),
+ FunctionTemplate->getDeclContext(),
+ *DeducedArgumentList));
if (!Specialization)
return TDK_SubstitutionFailure;