diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-11 18:10:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-11 18:10:32 +0000 |
commit | 02cbbd2d945e466174bee536758e5a2e6a1c0ea2 (patch) | |
tree | d85e18bd876fd31d6c771b44aa8c7c545eda6e4e /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 3b56c002591b59c6c257951f6613b44de83fa860 (diff) |
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
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index ee74b9a8bd..964d3b1485 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -185,18 +185,12 @@ void Sema::PrintInstantiationStack() { 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 @@ InstantiateFunctionProtoType(const FunctionProtoType *T, 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 @@ InstantiateTemplateSpecializationType( TemplateArgs); return SemaRef.CheckTemplateIdType(Name, Loc, SourceLocation(), - &InstantiatedTemplateArgs[0], + InstantiatedTemplateArgs.data(), InstantiatedTemplateArgs.size(), SourceLocation()); } |