summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-05 02:31:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-05 02:31:32 +0000
commitec7176e2235ae05e088dd3879a3b41104855388b (patch)
tree621ec244cc47df73e17c84a86839fd56552065a5 /clang/lib
parent4a23563c580b815f296ed50baf8234abd8b88607 (diff)
downloadbcm5719-llvm-ec7176e2235ae05e088dd3879a3b41104855388b.tar.gz
bcm5719-llvm-ec7176e2235ae05e088dd3879a3b41104855388b.zip
Fix assertion failure on deduction failure due to too short template argument list.
We were previously incorrectly using TDK_TooFewArguments to report a template argument list that's too short, but it actually means that the number of arguments in a top-level function call was insufficient. When diagnosing the problem, SemaOverload would (rightly) assert that the failure kind didn't make any sense. llvm-svn: 291064
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index c16b28bcf13..893c813485b 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -1899,8 +1899,9 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams,
// Check whether we have enough arguments.
if (!hasTemplateArgumentForDeduction(Args, ArgIdx))
- return NumberOfArgumentsMustMatch ? Sema::TDK_TooFewArguments
- : Sema::TDK_Success;
+ return NumberOfArgumentsMustMatch
+ ? Sema::TDK_MiscellaneousDeductionFailure
+ : Sema::TDK_Success;
// C++1z [temp.deduct.type]p9:
// During partial ordering, if Ai was originally a pack expansion [and]
OpenPOWER on IntegriCloud