http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19476
--- Comment #13 from Marc Glisse <glisse at gcc dot gnu.org> --- Without adding an attribute, can we identify those operator new that may not return 0? Is DECL_IS_OPERATOR_NEW && !TREE_NOTHROW good enough, or completely wrong? I am basing this on: "If the request succeeds, the value returned shall be a non-null pointer value (4.10)" "If an allocation function declared with a non-throwing exception-specification (15.4) fails to allocate storage, it shall return a null pointer. Any other allocation function that fails to allocate storage shall indicate failure only by throwing an exception". If the test is correct, adding one case to tree_expr_nonzero_warnv_p, gimple_stmt_nonzero_warnv_p (and maybe others as well?) should be easy.