1 // RUN: %clang_cc1 -std=c++11 -verify %s
3 template<typename ...T> struct X {};
5 template<typename T, typename U> struct P {};
8 template<typename ...T> int f1(X<T, T...>... a); // expected-note +{{conflicting types for parameter 'T'}}
9 template<typename ...T> int f2(P<X<T...>, T> ...a); // expected-note +{{conflicting types for parameter 'T'}}
11 int a1 = f1(X<int, int, double>(), X<double, int, double>());
12 int a2 = f1(X<int, int>());
13 int a3 = f1(X<int>(), X<double>()); // expected-error {{no matching}}
14 int a4 = f1(X<int, int>(), X<int>()); // expected-error {{no matching}}
15 int a5 = f1(X<int>(), X<int, int>()); // expected-error {{no matching}}
16 int a6 = f1(X<int, int, int>(), X<int, int, int>(), X<int, int, int, int>()); // expected-error {{no matching}}
18 int b1 = f2(P<X<int, double>, int>(), P<X<int, double>, double>());
19 int b2 = f2(P<X<int, double>, int>(), P<X<int, double>, double>(), P<X<int, double>, char>()); // expected-error {{no matching}}
23 template<typename T, typename U> struct A {};
24 template<typename ...Ts> void f(A<Ts...>); // expected-note {{substitution failure [with Ts = <char, short, int>]: too many template arg}}
26 void g(A<char, short> a) {
30 f<char, short, int>(a); // expected-error {{no matching function}}
34 namespace RetainExprPacks {
35 int f(int a, int b, int c);
36 template<typename ...Ts> struct X {};
37 template<typename ...Ts> int g(X<Ts...>, decltype(f(Ts()...)));
38 int n = g<int, int>(X<int, int, int>(), 0);
43 template <class A, class...> struct X {};
44 template <class... B> struct X<int, B...> {
48 template <typename A, typename... B, typename T = X<A, B...>,
49 typename = typename T::valid>
50 typename T::type check(int);
51 int i = check<int, char>(1);
55 template <class...> struct X;
56 template <typename... B, typename X<B...>::type I = 0>
57 char check(B...); // expected-note {{undefined template 'PR14615::comment2::X<char, int>'}}
58 void f() { check<char>(1, 2); } // expected-error {{no matching function}}
62 template <class...> struct X;
63 template <typename... B, typename X<B...>::type I = (typename X<B...>::type)0>
64 char check(B...); // expected-note {{undefined template 'PR14615::comment3::X<char, int>'}}
65 void f() { check<char>(1, 2); } // expected-error {{no matching function}}