diff options
Diffstat (limited to 'test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp')
-rw-r--r-- | test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp b/test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp index 21aa24f..485068e 100644 --- a/test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp +++ b/test/CXX/temp/temp.decls/temp.variadic/multi-level-substitution.cpp @@ -249,3 +249,46 @@ namespace PR10230 { int (&ir3)[3] = s<int>().f<int, float, double>(); } } + +namespace PR13386 { + template<typename...> struct tuple {}; + template<typename...T> + struct S { + template<typename...U> + void f(T &&...t, U &&...u) {} // expected-note {{candidate}} + template<typename...U> + void g(U &&...u, T &&...t) {} // expected-note {{candidate}} + template<typename...U> + void h(tuple<T, U> &&...) {} // expected-note 2{{candidate}} + + template<typename...U> + struct X { + template<typename...V> + void x(tuple<T, U, V> &&...); // expected-error {{different lengths}} + }; + }; + + void test() { + S<>().f(); + S<>().f(0); + S<int>().f(0); + S<int>().f(0, 1); + S<int, int>().f(0); // expected-error {{no matching member function for call}} + + S<>().g(); + S<>().g(0); + S<int>().g(0); + S<int>().g(0, 1); // expected-error {{no matching member function for call}} + S<int>().g<int>(0, 1); + S<int, int>().g(0, 1); + + S<>().h(); + S<>().h(0); // expected-error {{no matching member function for call}} + S<int>().h({}); // expected-error {{no matching member function for call}} + S<int>().h<int>({}); + S<int>().h(tuple<int,int>{}); + S<int, int>().h(tuple<int,int>{}, tuple<int,int>{}); + + S<int, int>::X<char>(); // expected-note {{here}} + } +} |