diff options
Diffstat (limited to 'clang/test/SemaTemplate/deduction.cpp')
-rw-r--r-- | clang/test/SemaTemplate/deduction.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/deduction.cpp b/clang/test/SemaTemplate/deduction.cpp index 1f1c30a8b4a..7268912dd6c 100644 --- a/clang/test/SemaTemplate/deduction.cpp +++ b/clang/test/SemaTemplate/deduction.cpp @@ -546,3 +546,21 @@ namespace designators { static_assert(f({.a = 1, .b = 2}) == 3, ""); // expected-error {{no matching function}} } + +namespace nested_packs { + template<typename ...T, typename ...U> void f(T (*...f)(U...)); // expected-note {{deduced packs of different lengths for parameter 'U' (<> vs. <int>)}} + void g() { f(g); f(g, g); f(g, g, g); } + void h(int) { f(h); f(h, h); f(h, h, h); } + void i() { f(g, h); } // expected-error {{no matching function}} + +#if __cplusplus >= 201703L + template<auto ...A> struct Q {}; + template<typename ...T, T ...A, T ...B> void q(Q<A...>, Q<B...>); // #q + void qt(Q<> q0, Q<1, 2> qii, Q<1, 2, 3> qiii) { + q(q0, q0); + q(qii, qii); + q(qii, qiii); // expected-error {{no match}} expected-note@#q {{deduced packs of different lengths for parameter 'T' (<int, int> vs. <int, int, int>)}} + q(q0, qiii); // expected-error {{no match}} expected-note@#q {{deduced packs of different lengths for parameter 'T' (<> vs. <int, int, int>)}} + } +#endif +} |