Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / disallow_void_deref.cpp
blob4e3313347d8186d72f85f80cf510a3b1a6b02b31
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
3 void f(void* p) {
4 (void)*p; // expected-error{{indirection not permitted on operand of type 'void *'}}
7 template<class T>
8 concept deref = requires (T& t) {
9 { *t }; // #FAILED_REQ
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 *'}}