[libcxx-commits] [PATCH] D150610: [libc++] Make sure `operator new` never returns nullptr, even under -fno-exceptions

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 15 14:06:20 PDT 2023


ldionne added subscribers: jwakely, EricWF, libc++ vendors.
ldionne added a comment.

Pinging vendors for discussion.

In particular, @EricWF  it would be nice to know how Google feels about this, given that it's a large code base built using `-fno-exceptions` (presumably the dylib too?).

Also, @jwakely I'd like to know how you feel about the fact that `new(size_t, nothrow_t)` aborts instead of returning `nullptr` when the shared library is built using `-fno-exceptions`. Is that a concious choice you made in libstdc++, and if so, what's the rationale? Naively, I would say this surely seems a bit surprising, but it seems to be the only way to satisfy the Standard's requirements under `-fno-exceptions` (since the `nothrow_t` version must call the throwing version).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150610/new/

https://reviews.llvm.org/D150610



More information about the libcxx-commits mailing list