summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-06-06 16:00:50 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-06-06 16:00:50 +0000
commit15fd3ff705a5657be800d3402d919eb8d13ec9f0 (patch)
tree143c9e71a36f6471a56a5bee73225cec49ca6147 /test/SemaTemplate
parenta4c4db1f56bea32f1736a77e4d5556d66d399c72 (diff)
downloadclang-15fd3ff705a5657be800d3402d919eb8d13ec9f0.tar.gz
clang-15fd3ff705a5657be800d3402d919eb8d13ec9f0.tar.bz2
clang-15fd3ff705a5657be800d3402d919eb8d13ec9f0.tar.xz
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
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/pack-deduction.cpp12
1 files changed, 12 insertions, 0 deletions
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<X<int, double>, int>(), P<X<int, double>, double>());
int b2 = f2(P<X<int, double>, int>(), P<X<int, double>, double>(), P<X<int, double>, char>()); // expected-error {{no matching}}
}
+
+namespace PR14841 {
+ template<typename T, typename U> struct A {};
+ template<typename ...Ts> void f(A<Ts...>); // expected-note {{substitution failure [with Ts = <char, short, int>]: too many template arg}}
+
+ void g(A<char, short> a) {
+ f(a);
+ f<char>(a);
+ f<char, short>(a);
+ f<char, short, int>(a); // expected-error {{no matching function}}
+ }
+}