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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The dup PR 65290 pointed out the requirements were changed by
http://cplusplus.github.io/LWG/lwg-defects.html#206 -- we still implement the
C++03 rules.

We should fix this. However, the C++11 requirement means that the nothrow
version of new has to pay for the throw/catch overhead. If we could tell when
these functions have not been replaced we could avoid that overhead.

Also we certainly don't want to conform to the new requirement when libstdc++
is built with -fno-exceptions, because allocation failure would abort in
operator new(size_t) and so the nothrow version never gets a chance to handle
the exception and return null.

We will also need to change operator new[](size_t, nothrow_t) which currently
calls operator new(size_t, nothrow_t), rather than operator new[](size_t) as
required. If a user only replaces operator new[](size_t) then their replacement
won't be called by operator new[](size_t, nothrow_t). Again, what we implement
is the C++03 rule.

Reply via email to