File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -237,3 +237,41 @@ void g() {
237
237
}
238
238
239
239
}
240
+
241
+ namespace nested {
242
+
243
+ template <typename ... T>
244
+ struct S {
245
+ template <typename ... U>
246
+ consteval static int f ()
247
+ requires ((A<T> && ...) && ... && A<U> ) {
248
+ return 1 ;
249
+ }
250
+
251
+ template <typename ... U>
252
+ consteval static int f ()
253
+ requires ((C<T> && ...) && ... && C<U> ) {
254
+ return 2 ;
255
+ }
256
+
257
+ template <typename ... U>
258
+ consteval static int g () // #nested-ambiguous-g1
259
+ requires ((A<T> && ...) && ... && A<U> ) {
260
+ return 1 ;
261
+ }
262
+
263
+ template <typename ... U>
264
+ consteval static int g () // #nested-ambiguous-g2
265
+ requires ((C<U> && ...) && ... && C<T> ) {
266
+ return 2 ;
267
+ }
268
+ };
269
+
270
+ static_assert (S<int >::f<int >() == 2 );
271
+
272
+ static_assert (S<int >::g<int >() == 2 ); // expected-error {{call to 'g' is ambiguous}}
273
+ // expected-note@#nested-ambiguous-g1 {{candidate}}
274
+ // expected-note@#nested-ambiguous-g2 {{candidate}}
275
+
276
+
277
+ }
You can’t perform that action at this time.
0 commit comments