summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorLarisse Voufo <lvoufo@google.com>2013-07-19 22:34:32 +0000
committerLarisse Voufo <lvoufo@google.com>2013-07-19 22:34:32 +0000
commit8d33da6d58f34bcb47397e9d8ccc7c340160d359 (patch)
tree6d127a92bd1758f9fe11e4a9f0579221acd1519c /clang/lib/Sema/SemaTemplateInstantiate.cpp
parent5e05c4afe48945b438d98a0efe9c6d6286b1bb9b (diff)
downloadbcm5719-llvm-8d33da6d58f34bcb47397e9d8ccc7c340160d359.tar.gz
bcm5719-llvm-8d33da6d58f34bcb47397e9d8ccc7c340160d359.zip
Use function overloading instead of template specialization for diagnosis of bad template argument deductions.
llvm-svn: 186727
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 3904daa47f1..7632bba8c9c 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -2252,15 +2252,18 @@ Sema::InstantiateClassTemplateSpecialization(
SmallVector<MatchResult, 4> Matched;
SmallVector<ClassTemplatePartialSpecializationDecl *, 4> PartialSpecs;
Template->getPartialSpecializations(PartialSpecs);
+ TemplateSpecCandidateSet FailedCandidates(PointOfInstantiation);
for (unsigned I = 0, N = PartialSpecs.size(); I != N; ++I) {
ClassTemplatePartialSpecializationDecl *Partial = PartialSpecs[I];
- TemplateDeductionInfo Info(PointOfInstantiation);
+ TemplateDeductionInfo Info(FailedCandidates.getLocation());
if (TemplateDeductionResult Result
= DeduceTemplateArguments(Partial,
ClassTemplateSpec->getTemplateArgs(),
Info)) {
- // FIXME: Store the failed-deduction information for use in
- // diagnostics, later.
+ // Store the failed-deduction information for use in diagnostics, later.
+ // TODO: Actually use the failed-deduction info?
+ FailedCandidates.addCandidate()
+ .set(Partial, MakeDeductionFailureInfo(Context, Result, Info));
(void)Result;
} else {
Matched.push_back(PartialSpecMatchResult());
OpenPOWER on IntegriCloud