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