xref: /llvm-project/clang/test/SemaCXX/null-cast.cpp (revision 0150333a3c565fec97d4d65302abbb15ed21ecc4)
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 struct A {};
4 struct B : virtual A {};
5 
foo()6 void foo() {
7   (void)static_cast<A&>(*(B *)0); // expected-warning {{binding dereferenced null pointer to reference has undefined behavior}}
8 }
9