bolt/deps/llvm-18.1.8/clang/test/SemaCXX/null-cast.cpp

9 lines
227 B
C++
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {};
struct B : virtual A {};
void foo() {
(void)static_cast<A&>(*(B *)0); // expected-warning {{binding dereferenced null pointer to reference has undefined behavior}}
}