aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-08-25 22:02:44 +0000
committerJohn McCall <rjmccall@apple.com>2009-08-25 22:02:44 +0000
commitce3ff2bd3a3386dbc209d3cba4b8769173b274c1 (patch)
tree13e2159191073ccb9c8beb00544e03f6194fa42f /lib/Sema/SemaTemplateDeduction.cpp
parent3ac6a0b8a35c86f830747865af209c6e1b8b84e6 (diff)
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
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 3a1722671f..ec198e0ffb 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -967,8 +967,8 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
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 @@ Sema::SubstituteExplicitTemplateArguments(
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 @@ Sema::SubstituteExplicitTemplateArguments(
= 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 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
// 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;