| 1 |
// { dg-do compile { target c++20 } } |
| 2 |
|
| 3 |
// But make sure we do consider template conversions that could produce the |
| 4 |
// right type. |
| 5 |
|
| 6 |
template <class T> |
| 7 |
struct Error { static constexpr auto value = T::value; }; // { dg-error "not a member" } |
| 8 |
|
| 9 |
struct A { A(const A&); }; |
| 10 |
|
| 11 |
template <class T> |
| 12 |
struct B { template <class U> operator U() requires Error<T>::value; }; |
| 13 |
|
| 14 |
template <class T> |
| 15 |
concept C = requires (B<T> b) { A(b); }; // { dg-message "required from here" } |
| 16 |
|
| 17 |
static_assert(!C<int>); |