9 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3struct A {};4struct B : virtual A {};5 6void foo() {7 (void)static_cast<A&>(*(B *)0); // expected-warning {{binding dereferenced null pointer to reference has undefined behavior}}8}9 1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3struct A {};4struct B : virtual A {};5 6void foo() {7 (void)static_cast<A&>(*(B *)0); // expected-warning {{binding dereferenced null pointer to reference has undefined behavior}}8}9