@@ -365,6 +365,35 @@ struct A {
365
365
#endif
366
366
} // namespace cwg2363
367
367
368
+ namespace cwg2369 { // cwg2369: partial
369
+ #if __cplusplus >= 202002L
370
+ template <class T > struct Z {
371
+ typedef typename T::x xx;
372
+ };
373
+
374
+ template <class T >
375
+ concept C = requires { typename T::A; };
376
+ template <C T> typename Z<T>::xx f (void *, T); // #1
377
+ template <class T > void f (int , T); // #2
378
+
379
+ struct A {
380
+ } a;
381
+
382
+ struct ZZ {
383
+ template <class T , class = typename Z<T>::xx> operator T *();
384
+ operator int ();
385
+ };
386
+
387
+ void foo () {
388
+ ZZ zz;
389
+ f (1 , a); // OK, deduction fails for #1 because there is no conversion from int
390
+ // to void*
391
+ f (zz, 42 ); // OK, deduction fails for #1 because C<int> is not satisfied
392
+ }
393
+
394
+ #endif
395
+ } // namespace cwg2369
396
+
368
397
namespace cwg2370 { // cwg2370: no
369
398
namespace N {
370
399
typedef int type;
@@ -495,32 +524,3 @@ namespace cwg2397 { // cwg2397: 17
495
524
}
496
525
#endif
497
526
} // namespace cwg2397
498
-
499
- namespace cwg2369 { // cwg2369: partial
500
- #if __cplusplus >= 202002L
501
- template <class T > struct Z {
502
- typedef typename T::x xx;
503
- };
504
-
505
- template <class T >
506
- concept C = requires { typename T::A; };
507
- template <C T> typename Z<T>::xx f (void *, T); // #1
508
- template <class T > void f (int , T); // #2
509
-
510
- struct A {
511
- } a;
512
-
513
- struct ZZ {
514
- template <class T , class = typename Z<T>::xx> operator T *();
515
- operator int ();
516
- };
517
-
518
- void foo () {
519
- ZZ zz;
520
- f (1 , a); // OK, deduction fails for #1 because there is no conversion from int
521
- // to void*
522
- f (zz, 42 ); // OK, deduction fails for #1 because C<int> is not satisfied
523
- }
524
-
525
- #endif
526
- } // namespace cwg2369
0 commit comments