@@ -40,13 +40,23 @@ constexpr int i(T...) { return 1; }; // expected-note {{candidate}}
40
40
static_assert (i(0 ) == 1 ); // expected-error {{call to 'i' is ambiguous}}
41
41
42
42
43
- template <class ... T> requires (A<T> || ... || true )
44
- constexpr int j(T...) { return 0 ; };
45
- template <class ... T> requires (C<T> && ... && true )
46
- constexpr int j(T...) { return 1 ; };
43
+ template <class ... T> requires (A<T> || ... || true ) constexpr int j(T...) { return 0 ; }; // #j1
44
+ template <class ... T> requires (C<T> && ... && true ) constexpr int j(T...) { return 1 ; }; // #j2
47
45
48
46
static_assert (j(0 ) == 1 );
47
+ // expected-error@-1 {{call to 'j' is ambiguous}}
48
+ // expected-note@#j1 {{candidate function [with T = <int>]}}
49
+ // expected-note@#j2 {{candidate function [with T = <int>]}}
50
+ // expected-note@#j2 {{imilar constraint expressions not considered equivalent}}
51
+ // expected-note@#j1 {{similar constraint expression here}}
52
+
53
+
49
54
static_assert (j() == 1 );
55
+ // expected-error@-1 {{call to 'j' is ambiguous}}
56
+ // expected-note@#j1 {{candidate function [with T = <>]}}
57
+ // expected-note@#j2 {{candidate function [with T = <>]}}
58
+ // expected-note@#j2 {{imilar constraint expressions not considered equivalent}}
59
+ // expected-note@#j1 {{similar constraint expression here}}
50
60
51
61
52
62
@@ -145,51 +155,41 @@ static_assert(And1<>() == 1);
145
155
static_assert (And1<S>() == 1 );
146
156
static_assert (And1<S, S>() == 1 );
147
157
static_assert (And1<int >() == 1 ); // expected-error {{no matching function for call to 'And1'}}
148
- // expected-note@#and1 {{candidate template ignored: constraints not satisfied}}
149
- // expected-note@#and1 {{because substituted constraint expression is ill-formed}}
158
+ // expected-note@#and1 {{candidate template ignored: failed template argument deduction}}
150
159
151
160
static_assert (And1<S, int >() == 1 ); // expected-error {{no matching function for call to 'And1'}}
152
- // expected-note@#and1 {{candidate template ignored: constraints not satisfied}}
153
- // expected-note@#and1 {{because substituted constraint expression is ill-formed}}
161
+ // expected-note@#and1 {{candidate template ignored: failed template argument deduction}}
154
162
155
163
static_assert (And1<int , S>() == 1 ); // expected-error {{no matching function for call to 'And1'}}
156
- // expected-note@#and1 {{candidate template ignored: constraints not satisfied}}
157
- // expected-note@#and1 {{because substituted constraint expression is ill-formed}}
164
+ // expected-note@#and1 {{candidate template ignored: failed template argument deduction}}
158
165
159
166
static_assert (And2<S>() == 2 );
160
167
static_assert (And2<S, S>() == 2 );
161
- // FIXME: Should it compile??
162
- static_assert (And2< int >() == 2 );
168
+ static_assert (And2< int >() == 2 ); // expected-error {{no matching function for call to 'And2'}} \
169
+ // expected-note@#and2 {{candidate template ignored: failed template argument deduction}}
163
170
164
171
static_assert (And2<int , int >() == 2 ); // expected-error {{no matching function for call to 'And2'}}
165
- // expected-note@#and2 {{candidate template ignored: constraints not satisfied}}
166
- // expected-note@#and2 {{because substituted constraint expression is ill-formed}}
172
+ // expected-note@#and2 {{candidate template ignored: failed template argument deduction}}
167
173
168
174
static_assert (And2<S, int >() == 2 ); // expected-error {{no matching function for call to 'And2'}}
169
- // expected-note@#and2 {{candidate template ignored: constraints not satisfied}}
170
- // expected-note@#and2 {{because substituted constraint expression is ill-formed}}
175
+ // expected-note@#and2 {{candidate template ignored: failed template argument deduction}}
171
176
172
177
static_assert (And2<int , S>() == 2 ); // expected-error {{no matching function for call to 'And2'}}
173
- // expected-note@#and2 {{candidate template ignored: constraints not satisfied}}
174
- // expected-note@#and2 {{because substituted constraint expression is ill-formed}}
178
+ // expected-note@#and2 {{candidate template ignored: failed template argument deduction}}
175
179
176
180
static_assert (And3<S>() == 3 );
177
181
static_assert (And3<S, S>() == 3 );
178
182
static_assert (And3<int >() == 3 ); // expected-error {{no matching function for call to 'And3'}}
179
- // expected-note@#and3 {{candidate template ignored: constraints not satisfied}}
180
- // expected-note@#and3 {{because substituted constraint expression is ill-formed}}
183
+ // expected-note@#and3 {{candidate template ignored: failed template argument deduction}}
181
184
182
185
static_assert (And3<int , int >() == 3 ); // expected-error {{no matching function for call to 'And3'}}
183
- // expected-note@#and3 {{candidate template ignored: constraints not satisfied}}
184
- // expected-note@#and3 {{because substituted constraint expression is ill-formed}}
186
+ // expected-note@#and3 {{candidate template ignored: failed template argument deduction}}
185
187
186
188
static_assert (And3<S, int >() == 3 ); // expected-error {{no matching function for call to 'And3'}}
187
- // expected-note@#and3 {{candidate template ignored: constraints not satisfied}}
188
- // expected-note@#and3 {{because substituted constraint expression is ill-formed}}
189
+ // expected-note@#and3 {{candidate template ignored: failed template argument deduction}}
189
190
190
191
static_assert (And3<int , S>() == 3 ); // expected-error {{no matching function for call to 'And3'}}
191
- // expected-note@#and3 {{candidate template ignored: constraints not satisfied}}
192
- // expected-note@#and3 {{because substituted constraint expression is ill-formed}}
192
+ // expected-note@#and3 {{candidate template ignored: failed template argument deduction}}
193
193
194
194
195
195
static_assert (Or1<>() == 1 ); // expected-error {{no matching function for call to 'Or1'}}
@@ -199,25 +199,20 @@ static_assert(Or1<int, S>() == 1);
199
199
static_assert (Or1<S, int >() == 1 );
200
200
static_assert (Or1<S, S>() == 1 );
201
201
static_assert (Or1<int >() == 1 ); // expected-error {{no matching function for call to 'Or1'}}
202
- // expected-note@#or1 {{candidate template ignored: constraints not satisfied}} \
203
- // expected-note@#or1 {{because substituted constraint expression is ill-formed}}
204
-
202
+ // expected-note@#or1 {{candidate template ignored: constraints not satisfied}}
205
203
206
204
static_assert (Or2<S>() == 2 );
207
205
static_assert (Or2<int , S>() == 2 );
208
206
static_assert (Or2<S, int >() == 2 );
209
207
static_assert (Or2<S, S>() == 2 );
210
208
static_assert (Or2<int >() == 2 ); // expected-error {{no matching function for call to 'Or2'}}
211
- // expected-note@#or2 {{candidate template ignored: constraints not satisfied}} \
212
- // expected-note@#or2 {{because substituted constraint expression is ill-formed}}
213
-
209
+ // expected-note@#or2 {{candidate template ignored: failed template argument deduction}}
214
210
static_assert (Or3<S>() == 3 );
215
211
static_assert (Or3<int , S>() == 3 );
216
212
static_assert (Or3<S, int >() == 3 );
217
213
static_assert (Or3<S, S>() == 3 );
218
214
static_assert (Or3<int >() == 3 ); // expected-error {{no matching function for call to 'Or3'}}
219
- // expected-note@#or3 {{candidate template ignored: constraints not satisfied}} \
220
- // expected-note@#or3 {{because substituted constraint expression is ill-formed}}
215
+ // expected-note@#or3 {{candidate template ignored: constraints not satisfied}}
221
216
}
222
217
223
218
namespace bool_conversion_break {
@@ -270,9 +265,7 @@ struct S {
270
265
271
266
static_assert (S<int >::f<int >() == 2 );
272
267
273
- static_assert (S<int >::g<int >() == 2 ); // expected-error {{call to 'g' is ambiguous}}
274
- // expected-note@#nested-ambiguous-g1 {{candidate}}
275
- // expected-note@#nested-ambiguous-g2 {{candidate}}
268
+ static_assert (S<int >::g<int >() == 2 );
276
269
277
270
278
271
}
0 commit comments