summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/pack-deduction.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-22 23:56:53 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-22 23:56:53 +0000
commit7c237990f2856551440fbabd5b031b5479da012c (patch)
tree07b1f0dd232f9343fcfc743803c01c24ba840224 /clang/test/SemaTemplate/pack-deduction.cpp
parent17e6b9e5ab404eddf2e58cdcfd7a4c8bc472da6e (diff)
downloadbcm5719-llvm-7c237990f2856551440fbabd5b031b5479da012c.tar.gz
bcm5719-llvm-7c237990f2856551440fbabd5b031b5479da012c.zip
PR14615: add (passing) tests for this already-fixed bug
llvm-svn: 213709
Diffstat (limited to 'clang/test/SemaTemplate/pack-deduction.cpp')
-rw-r--r--clang/test/SemaTemplate/pack-deduction.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/pack-deduction.cpp b/clang/test/SemaTemplate/pack-deduction.cpp
index f3f969e9af0..84eefa63d21 100644
--- a/clang/test/SemaTemplate/pack-deduction.cpp
+++ b/clang/test/SemaTemplate/pack-deduction.cpp
@@ -37,3 +37,31 @@ namespace RetainExprPacks {
template<typename ...Ts> int g(X<Ts...>, decltype(f(Ts()...)));
int n = g<int, int>(X<int, int, int>(), 0);
}
+
+namespace PR14615 {
+ namespace comment0 {
+ template <class A, class...> struct X {};
+ template <class... B> struct X<int, B...> {
+ typedef int type;
+ struct valid {};
+ };
+ template <typename A, typename... B, typename T = X<A, B...>,
+ typename = typename T::valid>
+ typename T::type check(int);
+ int i = check<int, char>(1);
+ }
+
+ namespace comment2 {
+ template <class...> struct X;
+ template <typename... B, typename X<B...>::type I = 0>
+ char check(B...); // expected-note {{undefined template 'PR14615::comment2::X<char, int>'}}
+ void f() { check<char>(1, 2); } // expected-error {{no matching function}}
+ }
+
+ namespace comment3 {
+ template <class...> struct X;
+ template <typename... B, typename X<B...>::type I = (typename X<B...>::type)0>
+ char check(B...); // expected-note {{undefined template 'PR14615::comment3::X<char, int>'}}
+ void f() { check<char>(1, 2); } // expected-error {{no matching function}}
+ }
+}
OpenPOWER on IntegriCloud