Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-p2113b.C

raw
1 // testcase from P2113
2 // { dg-do compile { target c++20 } }
3
4 template <typename> constexpr bool True = true;
5 template <typename T> concept C = True<T>;
6
7 void f(C auto &, auto &) = delete;
8 template <C Q> void f(Q &, C auto &);
9
10 void g(struct A *ap, struct B *bp) {
11 f(*ap, *bp); // OK: Can use different methods to produce template parameters
12 }
13
14 template <typename T, typename U> struct X {};
15
16 template <typename T1, C U1, typename V1>
17 bool operator==(X<T1, U1>, V1) = delete;
18
19 // In P2113 this candidate is reversed.
20 template <C T2, C U2, C V2>
21 bool operator==(X<T2, U2>, V2);
22
23 void h() {
24 X<void *, int>{} == 0; // OK
25 }