https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98646
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
A better one:
// PR c++/98646
// { dg-do compile }
// { dg-options "-Wnonnull" }
struct B {
void foo();
};
struct D : B {
void show();
};
void
D::show()
{
constexpr void *p = nullptr;
if (p)
static_cast<D *>(p)->foo();
}
