| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s |
| 2 |
|
| 3 |
void f(void* p) { |
| 4 |
(void)*p; // expected-error{{indirection not permitted on operand of type 'void *'}} |
| 5 |
} |
| 6 |
|
| 7 |
template<class T> |
| 8 |
concept deref = requires (T& t) { |
| 9 |
{ *t }; // #FAILED_REQ |
| 10 |
}; |
| 11 |
|
| 12 |
static_assert(deref<void*>); |
| 13 |
// expected-error@-1{{static assertion failed}} |
| 14 |
// expected-note@-2{{because 'void *' does not satisfy 'deref'}} |
| 15 |
// expected-note@#FAILED_REQ{{because '*t' would be invalid: indirection not permitted on operand of type 'void *'}} |