brintos

brintos / llvm-project-archived public Read only

0
0
Text · 508 B · 4e33133 Raw
16 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s2 3void f(void* p) {4  (void)*p; // expected-error{{indirection not permitted on operand of type 'void *'}}5}6 7template<class T>8concept deref = requires (T& t) {9      { *t }; // #FAILED_REQ10};11 12static_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 *'}}16