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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Why would you want an operator new that can't throw but is declared to
potentially throw? The exception specification is defined by the language to
inform the compiler whether to check the result or not, so use that.

IMHO if your operator new returns null instead of throwing then it should be
declared non-throwing (which can be done conditionally based on whether
exceptions are enabled).

If declaring it like that really isn't possible, then you should use
-fcheck-new, but it seems OK to not enable that automatically and rely on
correct exception specifications.

Reply via email to