summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-05 20:27:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-05 20:27:28 +0000
commit1c9f404a2528fa5953a556c5adfe1219f94653a9 (patch)
tree9b4d7b03a3e11c20d645dbab8e99052cf7d42130 /test/SemaTemplate
parent48cafe3de28bdac87ca3221fc2cc14fa522dfb29 (diff)
If an explicitly-specified pack might have been extended by template argument
deduction, don't forget to check the argument is valid. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/deduction.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp
index 940f6018f2..2275a8b3b7 100644
--- a/test/SemaTemplate/deduction.cpp
+++ b/test/SemaTemplate/deduction.cpp
@@ -428,3 +428,17 @@ namespace deduction_from_empty_list {
f<1>({0}, {0, 1}); // expected-error {{no matching}}
}
}
+
+namespace check_extended_pack {
+ template<typename T> struct X { typedef int type; };
+ template<typename ...T> void f(typename X<T>::type...);
+ template<typename T> void f(T, int, int);
+ void g() {
+ f<int>(0, 0, 0);
+ }
+
+ template<int, int*> struct Y {};
+ template<int ...N> void g(Y<N...>); // expected-note {{deduced non-type template argument does not have the same type as the corresponding template parameter ('int *' vs 'int')}}
+ int n;
+ void h() { g<0>(Y<0, &n>()); } // expected-error {{no matching function}}
+}