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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291064
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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]
void test() { j(x, f, x); }
}
}
+
+namespace b29946541 {
+ template<typename> class A {};
+ template<typename T, typename U, template<typename, typename> class C>
+ void f(C<T, U>); // expected-note {{failed template argument deduction}}
+ void g(A<int> a) { f(a); } // expected-error {{no match}}
+}