https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79578

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Maxim Egorushkin from comment #0)
> 2. The code assigns through that pointer, so the pointer must be valid.
> Therefore there is no need to test the result of new for 0.

In any case, we fixed the standard so that it's undefined to pass null to the
placement new operator, so the check should never happen now, without needing
to see the origin of the pointer or whether it is subsequently derferenced.

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1748

(See also PR 35878 comment 2)

Reply via email to