https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97151
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- Yes, operator new[](40) cannot return null, and passing null to memset is undefined, so we could assume it is never called with null.