From 15fd3ff705a5657be800d3402d919eb8d13ec9f0 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 6 Jun 2014 16:00:50 +0000 Subject: PR14841: If partial substitution of explicitly-specified template arguments results in a template having too many arguments, but all the trailing arguments are packs, that's OK if we have a partial pack substitution: the trailing pack expansions may end up empty. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210350 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaTemplate/pack-deduction.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/SemaTemplate/pack-deduction.cpp') diff --git a/test/SemaTemplate/pack-deduction.cpp b/test/SemaTemplate/pack-deduction.cpp index 2d0a03f0fc..abb76de693 100644 --- a/test/SemaTemplate/pack-deduction.cpp +++ b/test/SemaTemplate/pack-deduction.cpp @@ -18,3 +18,15 @@ namespace Nested { int b1 = f2(P, int>(), P, double>()); int b2 = f2(P, int>(), P, double>(), P, char>()); // expected-error {{no matching}} } + +namespace PR14841 { + template struct A {}; + template void f(A); // expected-note {{substitution failure [with Ts = ]: too many template arg}} + + void g(A a) { + f(a); + f(a); + f(a); + f(a); // expected-error {{no matching function}} + } +} -- cgit v1.2.1