| 1 |
// DR 2369 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
|
| 4 |
template <class T> struct Z { |
| 5 |
typedef typename T::x xx; |
| 6 |
}; |
| 7 |
template <class T> concept C = requires { typename T::A; }; // { dg-message "T::A" } |
| 8 |
template <C T> typename Z<T>::xx f(void *, T); // { dg-message "not satisfied" } |
| 9 |
|
| 10 |
struct A {} a; |
| 11 |
struct ZZ { |
| 12 |
template <class T, class = typename Z<T>::xx> operator T *(); |
| 13 |
operator int(); |
| 14 |
}; |
| 15 |
int main() { |
| 16 |
ZZ zz; |
| 17 |
f(1, a); // { dg-error "no match" } no conversion from int to void* |
| 18 |
// { dg-message "cannot convert" "" { target *-*-* } .-1 } |
| 19 |
f(zz, 42); // { dg-error "no match" } C<int> is not satisfied |
| 20 |
} |