Once we have deduced the template arguments of a class template
partial specialization, substitute those template arguments back into
the template arguments of the class template partial specialization to
see if the results still match the original template arguments.
This code is more general than it needs to be, since we don't yet
diagnose C++ [temp.class.spec]p9. However, it's likely to be needed
for function templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73196 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index ee74b9a..964d3b1 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -185,18 +185,12 @@
case ActiveTemplateInstantiation::PartialSpecDeductionInstantiation: {
ClassTemplatePartialSpecializationDecl *PartialSpec
= cast<ClassTemplatePartialSpecializationDecl>((Decl *)Active->Entity);
- std::string TemplateArgsStr
- = TemplateSpecializationType::PrintTemplateArgumentList(
- PartialSpec->getTemplateArgs().getFlatArgumentList(),
- PartialSpec->getTemplateArgs().flat_size(),
- Context.PrintingPolicy);
// FIXME: The active template instantiation's template arguments
// are interesting, too. We should add something like [with T =
// foo, U = bar, etc.] to the string.
Diags.Report(FullSourceLoc(Active->PointOfInstantiation, SourceMgr),
diag::note_partial_spec_deduct_instantiation_here)
- << (PartialSpec->getSpecializedTemplate()->getNameAsString() +
- TemplateArgsStr)
+ << Context.getTypeDeclType(PartialSpec)
<< Active->InstantiationRange;
break;
}
@@ -441,7 +435,7 @@
ParamTypes.push_back(P);
}
- return SemaRef.BuildFunctionType(ResultType, &ParamTypes[0],
+ return SemaRef.BuildFunctionType(ResultType, ParamTypes.data(),
ParamTypes.size(),
T->isVariadic(), T->getTypeQuals(),
Loc, Entity);
@@ -567,7 +561,7 @@
TemplateArgs);
return SemaRef.CheckTemplateIdType(Name, Loc, SourceLocation(),
- &InstantiatedTemplateArgs[0],
+ InstantiatedTemplateArgs.data(),
InstantiatedTemplateArgs.size(),
SourceLocation());
}