blob: 9addcc50aec60f032cdd73728ac7cd2ff5e8419a [file] [log] [blame]
Richard Trieu246b6aa2012-06-26 18:18:47 +00001// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-NOTREE
2// RUN: %clang_cc1 -fsyntax-only %s -fno-elide-type -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-NOTREE
3// RUN: %clang_cc1 -fsyntax-only %s -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-ELIDE-TREE
4// RUN: %clang_cc1 -fsyntax-only %s -fno-elide-type -fdiagnostics-show-template-tree -std=c++11 2>&1 | FileCheck %s -check-prefix=CHECK-NOELIDE-TREE
5
6// PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'"
7// vector<string> refers to two different types here. Make sure the message
8// gives a way to tell them apart.
9class versa_string;
10typedef versa_string string;
11
12namespace std {template <typename T> class vector;}
13using std::vector;
14
15void f(vector<string> v);
16
17namespace std {
18 class basic_string;
19 typedef basic_string string;
20 template <typename T> class vector {};
21 void g() {
22 vector<string> v;
23 f(v);
24 }
25} // end namespace std
26// CHECK-ELIDE-NOTREE: no matching function for call to 'f'
27// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<class std::basic_string>' to 'vector<class versa_string>' for 1st argument
28// CHECK-NOELIDE-NOTREE: no matching function for call to 'f'
29// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'vector<class std::basic_string>' to 'vector<class versa_string>' for 1st argument
30// CHECK-ELIDE-TREE: no matching function for call to 'f'
Richard Trieu648e7632012-06-29 23:11:10 +000031// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +000032// CHECK-ELIDE-TREE: vector<
33// CHECK-ELIDE-TREE: [class std::basic_string != class versa_string]>
34// CHECK-NOELIDE-TREE: no matching function for call to 'f'
Richard Trieu648e7632012-06-29 23:11:10 +000035// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +000036// CHECK-NOELIDE-TREE: vector<
37// CHECK-NOELIDE-TREE: [class std::basic_string != class versa_string]>
38
39template <int... A>
40class I1{};
41void set1(I1<1,2,3,4,2,3,4,3>) {};
42void test1() {
43 set1(I1<1,2,3,4,2,2,4,3,7>());
44}
45// CHECK-ELIDE-NOTREE: no matching function for call to 'set1'
46// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I1<[5 * ...], 2, [2 * ...], 7>' to 'I1<[5 * ...], 3, [2 * ...], (no argument)>' for 1st argument
47// CHECK-NOELIDE-NOTREE: no matching function for call to 'set1'
48// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I1<1, 2, 3, 4, 2, 2, 4, 3, 7>' to 'I1<1, 2, 3, 4, 2, 3, 4, 3, (no argument)>' for 1st argument
49// CHECK-ELIDE-TREE: no matching function for call to 'set1'
Richard Trieu648e7632012-06-29 23:11:10 +000050// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +000051// CHECK-ELIDE-TREE: I1<
52// CHECK-ELIDE-TREE: [5 * ...],
53// CHECK-ELIDE-TREE: [2 != 3],
54// CHECK-ELIDE-TREE: [2 * ...],
55// CHECK-ELIDE-TREE: [7 != (no argument)]>
56// CHECK-NOELIDE-TREE: no matching function for call to 'set1'
Richard Trieu648e7632012-06-29 23:11:10 +000057// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +000058// CHECK-NOELIDE-TREE: I1<
59// CHECK-NOELIDE-TREE: 1,
60// CHECK-NOELIDE-TREE: 2,
61// CHECK-NOELIDE-TREE: 3,
62// CHECK-NOELIDE-TREE: 4,
63// CHECK-NOELIDE-TREE: 2,
64// CHECK-NOELIDE-TREE: [2 != 3],
65// CHECK-NOELIDE-TREE: 4,
66// CHECK-NOELIDE-TREE: 3,
67// CHECK-NOELIDE-TREE: [7 != (no argument)]>
68
69template <class A, class B, class C = void>
70class I2{};
71void set2(I2<int, int>) {};
72void test2() {
73 set2(I2<double, int, int>());
74}
75// CHECK-ELIDE-NOTREE: no matching function for call to 'set2'
76// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I2<double, [...], int>' to 'I2<int, [...], (default) void>' for 1st argument
77// CHECK-NOELIDE-NOTREE: no matching function for call to 'set2'
78// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I2<double, int, int>' to 'I2<int, int, (default) void>' for 1st argument
79// CHECK-ELIDE-TREE: no matching function for call to 'set2'
Richard Trieu648e7632012-06-29 23:11:10 +000080// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +000081// CHECK-ELIDE-TREE: I2<
82// CHECK-ELIDE-TREE: [double != int],
83// CHECK-ELIDE-TREE: [...],
84// CHECK-ELIDE-TREE: [int != (default) void]>
85// CHECK-NOELIDE-TREE: no matching function for call to 'set2'
Richard Trieu648e7632012-06-29 23:11:10 +000086// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +000087// CHECK-NOELIDE-TREE: I2<
88// CHECK-NOELIDE-TREE: [double != int],
89// CHECK-NOELIDE-TREE: int,
90// CHECK-NOELIDE-TREE: [int != (default) void]>
91
92int V1, V2, V3;
93template <int* A, int *B>
94class I3{};
95void set3(I3<&V1, &V2>) {};
96void test3() {
97 set3(I3<&V3, &V2>());
98}
99// CHECK-ELIDE-NOTREE: no matching function for call to 'set3'
100// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'I3<&V3, [...]>' to 'I3<&V1, [...]>' for 1st argument
101// CHECK-NOELIDE-NOTREE: no matching function for call to 'set3'
102// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'I3<&V3, &V2>' to 'I3<&V1, &V2>' for 1st argument
103// CHECK-ELIDE-TREE: no matching function for call to 'set3'
Richard Trieu648e7632012-06-29 23:11:10 +0000104// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000105// CHECK-ELIDE-TREE: I3<
106// CHECK-ELIDE-TREE: [&V3 != &V1]
107// CHECK-ELIDE-TREE: [...]>
108// CHECK-NOELIDE-TREE: no matching function for call to 'set3'
Richard Trieu648e7632012-06-29 23:11:10 +0000109// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000110// CHECK-NOELIDE-TREE: I3<
111// CHECK-NOELIDE-TREE: [&V3 != &V1]
112// CHECK-NOELIDE-TREE: &V2>
113
114template <class A, class B>
115class Alpha{};
116template <class A, class B>
117class Beta{};
118template <class A, class B>
119class Gamma{};
120template <class A, class B>
121class Delta{};
122
123void set4(Alpha<int, int>);
124void test4() {
125 set4(Beta<void, void>());
126}
127// CHECK-ELIDE-NOTREE: no matching function for call to 'set4'
128// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument
129// CHECK-NOELIDE-NOTREE: no matching function for call to 'set4'
130// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument
131// CHECK-ELIDE-TREE: no matching function for call to 'set4'
132// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument
133// CHECK-NOELIDE-TREE: no matching function for call to 'set4'
134// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from 'Beta<void, void>' to 'Alpha<int, int>' for 1st argument
135
136void set5(Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>);
137void test5() {
138 set5(Alpha<Beta<Gamma<void, void>, double>, double>());
139}
140// CHECK-ELIDE-NOTREE: no matching function for call to 'set5'
141// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Gamma<void, void>, double>, double>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument
142// CHECK-NOELIDE-NOTREE: no matching function for call to 'set5'
143// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Gamma<void, void>, double>, double>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument
144// CHECK-ELIDE-TREE: no matching function for call to 'set5'
Richard Trieu648e7632012-06-29 23:11:10 +0000145// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000146// CHECK-ELIDE-TREE: Alpha<
147// CHECK-ELIDE-TREE: Beta<
148// CHECK-ELIDE-TREE: Gamma<
149// CHECK-ELIDE-TREE: [void != Delta<int, int>],
150// CHECK-ELIDE-TREE: [void != int]>
151// CHECK-ELIDE-TREE: [double != int]>
152// CHECK-ELIDE-TREE: [double != int]>
153// CHECK-NOELIDE-TREE: no matching function for call to 'set5'
Richard Trieu648e7632012-06-29 23:11:10 +0000154// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000155// CHECK-NOELIDE-TREE: Alpha<
156// CHECK-NOELIDE-TREE: Beta<
157// CHECK-NOELIDE-TREE: Gamma<
158// CHECK-NOELIDE-TREE: [void != Delta<int, int>],
159// CHECK-NOELIDE-TREE: [void != int]>
160// CHECK-NOELIDE-TREE: [double != int]>
161// CHECK-NOELIDE-TREE: [double != int]>
162
163void test6() {
164 set5(Alpha<Beta<Delta<int, int>, int>, int>());
165}
166// CHECK-ELIDE-NOTREE: no matching function for call to 'set5'
167// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Delta<int, int>, [...]>, [...]>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, [...]>, [...]>' for 1st argument
168// CHECK-NOELIDE-NOTREE: no matching function for call to 'set5'
169// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'Alpha<Beta<Delta<int, int>, int>, int>' to 'Alpha<Beta<Gamma<Delta<int, int>, int>, int>, int>' for 1st argument
170// CHECK-ELIDE-TREE: no matching function for call to 'set5'
Richard Trieu648e7632012-06-29 23:11:10 +0000171// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000172// CHECK-ELIDE-TREE: Alpha<
173// CHECK-ELIDE-TREE: Beta<
174// CHECK-ELIDE-TREE: [Delta<int, int> != Gamma<Delta<int, int>, int>],
175// CHECK-ELIDE-TREE: [...]>
176// CHECK-ELIDE-TREE: [...]>
177// CHECK-NOELIDE-TREE: no matching function for call to 'set5'
Richard Trieu648e7632012-06-29 23:11:10 +0000178// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000179// CHECK-NOELIDE-TREE: Alpha<
180// CHECK-NOELIDE-TREE: Beta<
181// CHECK-NOELIDE-TREE: [Delta<int, int> != Gamma<Delta<int, int>, int>],
182// CHECK-NOELIDE-TREE: int>
183// CHECK-NOELIDE-TREE: int>
184
185int a7, b7;
186int c7[] = {1,2,3};
187template<int *A>
188class class7 {};
189void set7(class7<&a7> A) {}
190void test7() {
191 set7(class7<&a7>());
192 set7(class7<&b7>());
193 set7(class7<c7>());
194 set7(class7<nullptr>());
195}
196// CHECK-ELIDE-NOTREE: no matching function for call to 'set7'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000197// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000198// CHECK-ELIDE-NOTREE: no matching function for call to 'set7'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000199// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<c7>' to 'class7<&a7>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000200// CHECK-ELIDE-NOTREE: no matching function for call to 'set7'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000201// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<nullptr>' to 'class7<&a7>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000202// CHECK-NOELIDE-NOTREE: no matching function for call to 'set7'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000203// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000204// CHECK-NOELIDE-NOTREE: no matching function for call to 'set7'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000205// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<c7>' to 'class7<&a7>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000206// CHECK-NOELIDE-NOTREE: no matching function for call to 'set7'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000207// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<nullptr>' to 'class7<&a7>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000208// CHECK-ELIDE-TREE: no matching function for call to 'set7'
Richard Trieu648e7632012-06-29 23:11:10 +0000209// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000210// CHECK-ELIDE-TREE: class7<
211// CHECK-ELIDE-TREE: [&b7 != &a7]>
212// CHECK-ELIDE-TREE: no matching function for call to 'set7'
Richard Trieu648e7632012-06-29 23:11:10 +0000213// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000214// CHECK-ELIDE-TREE: class7<
215// CHECK-ELIDE-TREE: [c7 != &a7]>
216// CHECK-ELIDE-TREE: no matching function for call to 'set7'
Richard Trieu648e7632012-06-29 23:11:10 +0000217// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000218// CHECK-ELIDE-TREE: class7<
219// CHECK-ELIDE-TREE: [nullptr != &a7]>
220// CHECK-NOELIDE-TREE: no matching function for call to 'set7'
Richard Trieu648e7632012-06-29 23:11:10 +0000221// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000222// CHECK-NOELIDE-TREE: class7<
223// CHECK-NOELIDE-TREE: [&b7 != &a7]>
224// CHECK-NOELIDE-TREE: no matching function for call to 'set7'
Richard Trieu648e7632012-06-29 23:11:10 +0000225// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000226// CHECK-NOELIDE-TREE: class7<
227// CHECK-NOELIDE-TREE: [c7 != &a7]>
228// CHECK-NOELIDE-TREE: no matching function for call to 'set7'
Richard Trieu648e7632012-06-29 23:11:10 +0000229// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000230// CHECK-NOELIDE-TREE: class7<
231// CHECK-NOELIDE-TREE: [nullptr != &a7]>
232
233template<typename ...T> struct S8 {};
234template<typename T> using U8 = S8<int, char, T>;
235int f8(S8<int, char, double>);
236int k8 = f8(U8<char>());
237// CHECK-ELIDE-NOTREE: no matching function for call to 'f8'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000238// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<[2 * ...], char>' to 'S8<[2 * ...], double>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000239// CHECK-NOELIDE-NOTREE: no matching function for call to 'f8'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000240// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<int, char, char>' to 'S8<int, char, double>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000241// CHECK-ELIDE-TREE: no matching function for call to 'f8'
Richard Trieu648e7632012-06-29 23:11:10 +0000242// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000243// CHECK-ELIDE-TREE: S8<
244// CHECK-ELIDE-TREE: [2 * ...],
245// CHECK-ELIDE-TREE: [char != double]>
246// CHECK-NOELIDE-TREE: no matching function for call to 'f8'
Richard Trieu648e7632012-06-29 23:11:10 +0000247// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000248// CHECK-NOELIDE-TREE: S8<
249// CHECK-NOELIDE-TREE: int,
250// CHECK-NOELIDE-TREE: char,
251// CHECK-NOELIDE-TREE: [char != double]>
252
253template<typename ...T> struct S9 {};
254template<typename T> using U9 = S9<int, char, T>;
255template<typename T> using V9 = U9<U9<T>>;
256int f9(S9<int, char, U9<const double>>);
257int k9 = f9(V9<double>());
258
259// CHECK-ELIDE-NOTREE: no matching function for call to 'f9'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000260// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<[2 * ...], S9<[2 * ...], double>>' to 'S9<[2 * ...], S9<[2 * ...], const double>>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000261// CHECK-NOELIDE-NOTREE: no matching function for call to 'f9'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000262// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<int, char, S9<int, char, double>>' to 'S9<int, char, S9<int, char, const double>>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000263// CHECK-ELIDE-TREE: no matching function for call to 'f9'
Richard Trieu648e7632012-06-29 23:11:10 +0000264// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000265// CHECK-ELIDE-TREE: S9<
266// CHECK-ELIDE-TREE: [2 * ...],
267// CHECK-ELIDE-TREE: S9<
268// CHECK-ELIDE-TREE: [2 * ...],
269// CHECK-ELIDE-TREE: [double != const double]>>
270// CHECK-NOELIDE-TREE: no matching function for call to 'f9'
Richard Trieu648e7632012-06-29 23:11:10 +0000271// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000272// CHECK-NOELIDE-TREE: S9<
273// CHECK-NOELIDE-TREE: int,
274// CHECK-NOELIDE-TREE: char,
275// CHECK-NOELIDE-TREE: S9<
276// CHECK-NOELIDE-TREE: int,
277// CHECK-NOELIDE-TREE: char,
278// CHECK-NOELIDE-TREE: [double != const double]>>
279
280template<typename ...A> class class_types {};
281void set10(class_types<int, int>) {}
282void test10() {
283 set10(class_types<int>());
284 set10(class_types<int, int, int>());
285}
286
287// CHECK-ELIDE-NOTREE: no matching function for call to 'set10'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000288// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[...], (no argument)>' to 'class_types<[...], int>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000289// CHECK-ELIDE-NOTREE: no matching function for call to 'set10'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000290// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[2 * ...], int>' to 'class_types<[2 * ...], (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000291// CHECK-NOELIDE-NOTREE: no matching function for call to 'set10'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000292// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<int, (no argument)>' to 'class_types<int, int>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000293// CHECK-NOELIDE-NOTREE: no matching function for call to 'set10'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000294// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<int, int, int>' to 'class_types<int, int, (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000295// CHECK-ELIDE-TREE: no matching function for call to 'set10'
Richard Trieu648e7632012-06-29 23:11:10 +0000296// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000297// CHECK-ELIDE-TREE: class_types<
298// CHECK-ELIDE-TREE: [...],
299// CHECK-ELIDE-TREE: [(no argument) != int]>
300// CHECK-ELIDE-TREE: no matching function for call to 'set10'
Richard Trieu648e7632012-06-29 23:11:10 +0000301// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000302// CHECK-ELIDE-TREE: class_types<
303// CHECK-ELIDE-TREE: [2 * ...],
304// CHECK-ELIDE-TREE: [int != (no argument)]>
305// CHECK-NOELIDE-TREE: no matching function for call to 'set10'
Richard Trieu648e7632012-06-29 23:11:10 +0000306// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000307// CHECK-NOELIDE-TREE: class_types<
308// CHECK-NOELIDE-TREE: int,
309// CHECK-NOELIDE-TREE: [(no argument) != int]>
310// CHECK-NOELIDE-TREE: no matching function for call to 'set10'
Richard Trieu648e7632012-06-29 23:11:10 +0000311// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000312// CHECK-NOELIDE-TREE: class_types<
313// CHECK-NOELIDE-TREE: int,
314// CHECK-NOELIDE-TREE: int,
315// CHECK-NOELIDE-TREE: [int != (no argument)]>
316
317template<int ...A> class class_ints {};
318void set11(class_ints<2, 3>) {}
319void test11() {
320 set11(class_ints<1>());
321 set11(class_ints<0, 3, 6>());
322}
323// CHECK-ELIDE-NOTREE: no matching function for call to 'set11'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000324// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000325// CHECK-ELIDE-NOTREE: no matching function for call to 'set11'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000326// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, [...], 6>' to 'class_ints<2, [...], (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000327// CHECK-NOELIDE-NOTREE: no matching function for call to 'set11'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000328// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000329// CHECK-NOELIDE-NOTREE: no matching function for call to 'set11'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000330// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, 3, 6>' to 'class_ints<2, 3, (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000331// CHECK-ELIDE-TREE: no matching function for call to 'set11'
Richard Trieu648e7632012-06-29 23:11:10 +0000332// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000333// CHECK-ELIDE-TREE: class_ints<
334// CHECK-ELIDE-TREE: [1 != 2],
335// CHECK-ELIDE-TREE: [(no argument) != 3]>
336// CHECK-ELIDE-TREE: no matching function for call to 'set11'
Richard Trieu648e7632012-06-29 23:11:10 +0000337// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000338// CHECK-ELIDE-TREE: class_ints<
339// CHECK-ELIDE-TREE: [0 != 2],
340// CHECK-ELIDE-TREE: [...],
341// CHECK-ELIDE-TREE: [6 != (no argument)]>
342// CHECK-NOELIDE-TREE: no matching function for call to 'set11'
Richard Trieu648e7632012-06-29 23:11:10 +0000343// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000344// CHECK-NOELIDE-TREE: class_ints<
345// CHECK-NOELIDE-TREE: [1 != 2],
346// CHECK-NOELIDE-TREE: [(no argument) != 3]>
347// CHECK-NOELIDE-TREE: no matching function for call to 'set11'
Richard Trieu648e7632012-06-29 23:11:10 +0000348// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000349// CHECK-NOELIDE-TREE: class_ints<
350// CHECK-NOELIDE-TREE: [0 != 2],
351// CHECK-NOELIDE-TREE: 3,
352// CHECK-NOELIDE-TREE: [6 != (no argument)]>
353
354template<template<class> class ...A> class class_template_templates {};
355template<class> class tt1 {};
356template<class> class tt2 {};
357void set12(class_template_templates<tt1, tt1>) {}
358void test12() {
359 set12(class_template_templates<tt2>());
360 set12(class_template_templates<tt1, tt1, tt1>());
361}
362// CHECK-ELIDE-NOTREE: no matching function for call to 'set12'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000363// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt2, template (no argument)>' to 'class_template_templates<template tt1, template tt1>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000364// CHECK-ELIDE-NOTREE: no matching function for call to 'set12'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000365// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<[2 * ...], template tt1>' to 'class_template_templates<[2 * ...], template (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000366// CHECK-NOELIDE-NOTREE: no matching function for call to 'set12'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000367// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt2, template (no argument)>' to 'class_template_templates<template tt1, template tt1>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000368// CHECK-NOELIDE-NOTREE: no matching function for call to 'set12'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000369// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates<template tt1, template tt1, template tt1>' to 'class_template_templates<template tt1, template tt1, template (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000370// CHECK-ELIDE-TREE: no matching function for call to 'set12'
Richard Trieu648e7632012-06-29 23:11:10 +0000371// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000372// CHECK-ELIDE-TREE: class_template_templates<
373// CHECK-ELIDE-TREE: [template tt2 != template tt1],
374// CHECK-ELIDE-TREE: [template (no argument) != template tt1]>
375// CHECK-ELIDE-TREE: no matching function for call to 'set12'
Richard Trieu648e7632012-06-29 23:11:10 +0000376// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000377// CHECK-ELIDE-TREE: class_template_templates<
378// CHECK-ELIDE-TREE: [2 * ...],
379// CHECK-ELIDE-TREE: [template tt1 != template (no argument)]>
380// CHECK-NOELIDE-TREE: no matching function for call to 'set12'
Richard Trieu648e7632012-06-29 23:11:10 +0000381// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000382// CHECK-NOELIDE-TREE: class_template_templates<
383// CHECK-NOELIDE-TREE: [template tt2 != template tt1],
384// CHECK-NOELIDE-TREE: [template (no argument) != template tt1]>
385// CHECK-NOELIDE-TREE: no matching function for call to 'set12'
Richard Trieu648e7632012-06-29 23:11:10 +0000386// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000387// CHECK-NOELIDE-TREE: class_template_templates<
388// CHECK-NOELIDE-TREE: template tt1,
389// CHECK-NOELIDE-TREE: template tt1,
390// CHECK-NOELIDE-TREE: [template tt1 != template (no argument)]>
391
392double a13, b13, c13, d13;
393template<double* ...A> class class_ptrs {};
394void set13(class_ptrs<&a13, &b13>) {}
395void test13() {
396 set13(class_ptrs<&c13>());
397 set13(class_ptrss<&a13, &b13, &d13>());
398}
399// CHECK-ELIDE-NOTREE: no matching function for call to 'set13'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000400// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&c13, (no argument)>' to 'class_ptrs<&a13, &b13>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000401// CHECK-ELIDE-NOTREE: no matching function for call to 'set13'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000402// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<[2 * ...], &d13>' to 'class_ptrs<[2 * ...], (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000403// CHECK-NOELIDE-NOTREE: no matching function for call to 'set13'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000404// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&c13, (no argument)>' to 'class_ptrs<&a13, &b13>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000405// CHECK-NOELIDE-NOTREE: no matching function for call to 'set13'
Matt Beaumont-Gay712692e2012-06-28 19:20:41 +0000406// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ptrs<&a13, &b13, &d13>' to 'class_ptrs<&a13, &b13, (no argument)>' for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000407// CHECK-ELIDE-TREE: no matching function for call to 'set13'
Richard Trieu648e7632012-06-29 23:11:10 +0000408// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000409// CHECK-ELIDE-TREE: class_ptrs<
410// CHECK-ELIDE-TREE: [&c13 != &a13],
411// CHECK-ELIDE-TREE: [(no argument) != &b13]>
412// CHECK-ELIDE-TREE: no matching function for call to 'set13'
Richard Trieu648e7632012-06-29 23:11:10 +0000413// CHECK-ELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000414// CHECK-ELIDE-TREE: class_ptrs<
415// CHECK-ELIDE-TREE: [2 * ...],
416// CHECK-ELIDE-TREE: [&d13 != (no argument)]>
417// CHECK-NOELIDE-TREE: no matching function for call to 'set13'
Richard Trieu648e7632012-06-29 23:11:10 +0000418// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000419// CHECK-NOELIDE-TREE: class_ptrs<
420// CHECK-NOELIDE-TREE: [&c13 != &a13],
421// CHECK-NOELIDE-TREE: [(no argument) != &b13]>
422// CHECK-NOELIDE-TREE: no matching function for call to 'set13'
Richard Trieu648e7632012-06-29 23:11:10 +0000423// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion from argument type to parameter type for 1st argument
Richard Trieu246b6aa2012-06-26 18:18:47 +0000424// CHECK-NOELIDE-TREE: class_ptrs<
425// CHECK-NOELIDE-TREE: &a13,
426// CHECK-NOELIDE-TREE: &b13,
427// CHECK-NOELIDE-TREE: [&d13 != (no argument)]>
428
429
430// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
431// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
432// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.
433// CHECK-NOELIDE-TREE: {{[0-9]*}} errors generated.