| 1 |
// PR c++/93907 |
| 2 |
// { dg-options -std=gnu++20 } |
| 3 |
|
| 4 |
template <int a> struct c { |
| 5 |
static constexpr int d = a; |
| 6 |
typedef c e; |
| 7 |
}; |
| 8 |
template <typename> struct f; |
| 9 |
template <typename b> using g = typename f<b>::e; |
| 10 |
struct b; |
| 11 |
template <typename b> struct f { using e = b; }; |
| 12 |
template <typename ai> struct m { typedef g<ai> aj; }; |
| 13 |
template <typename b> struct n { typedef typename m<b>::aj e; }; |
| 14 |
template <typename b> using an = typename n<b>::e; |
| 15 |
template <typename> constexpr bool ao = c<true>::d; |
| 16 |
template <typename> constexpr bool i = c<1>::d; |
| 17 |
template <typename> concept bb = i<b>; |
| 18 |
#ifdef __SIZEOF_INT128__ |
| 19 |
using cc = __int128; |
| 20 |
#else |
| 21 |
using cc = long long; |
| 22 |
#endif |
| 23 |
template <typename> concept cd = bb<cc>; |
| 24 |
template <typename bt> concept ce = requires { requires cd<bt>; }; |
| 25 |
template <typename bt> concept h = ce<bt>; |
| 26 |
template <typename bt> concept l = h<bt>; |
| 27 |
template <typename> concept cl = ao<b>; |
| 28 |
template <typename b> concept cp = requires(b j) { |
| 29 |
requires h<an<decltype(j.begin())>>; |
| 30 |
}; |
| 31 |
struct o { |
| 32 |
template <cl b> requires cp<b> auto operator()(b) {} |
| 33 |
}; |
| 34 |
template <typename b> using cm = decltype(o{}(b())); |
| 35 |
template <typename bt> concept ct = l<bt>; |
| 36 |
template <typename da> concept dd = ct<cm<da>>; |
| 37 |
template <typename da> concept de = dd<da>; |
| 38 |
struct { |
| 39 |
template <de da, typename b> void operator()(da, b); |
| 40 |
} di; |
| 41 |
struct p { |
| 42 |
void begin(); |
| 43 |
}; |
| 44 |
template <typename> using df = p; |
| 45 |
template <int> void q() { |
| 46 |
df<int> k; |
| 47 |
int d; |
| 48 |
di(k, d); |
| 49 |
} |