https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95663
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- So yes, the static_cast should evaluate to zero, but if it's followed by a dereference then it seems reasonable to expect -fdelete-null-pointer-checks to optimize away the handling for zero.