Skip to content

Commit 1229b78

Browse files
committed
[clang][NFC] Clean up CWG2396 test
1 parent 7cb6e6b commit 1229b78

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

clang/test/CXX/drs/cwg23xx.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,35 @@ struct A {
365365
#endif
366366
} // namespace cwg2363
367367

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+
368397
namespace cwg2370 { // cwg2370: no
369398
namespace N {
370399
typedef int type;
@@ -495,32 +524,3 @@ namespace cwg2397 { // cwg2397: 17
495524
}
496525
#endif
497526
} // 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

clang/www/cxx_dr_status.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16464,7 +16464,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1646416464
<td><a href="https://cplusplus.github.io/CWG/issues/2770.html">2770</a></td>
1646516465
<td>open</td>
1646616466
<td>Trailing <I>requires-clause</I> can refer to function parameters before they are substituted into</td>
16467-
<td align="center">Clang 20</td>
16467+
<td align="center">
16468+
<details>
16469+
<summary>Not resolved</summary>
16470+
Clang 20 implements 2023-07-14 resolution
16471+
</details></td>
1646816472
</tr>
1646916473
<tr id="2771">
1647016474
<td><a href="https://cplusplus.github.io/CWG/issues/2771.html">2771</a></td>

0 commit comments

Comments
 (0)