[libcxx-commits] [PATCH] D109459: [libc++][ABI BREAK] Remove the C++03 emulation for std::nullptr_t

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 8 12:47:18 PDT 2021


ldionne marked an inline comment as done.
ldionne added a comment.

In D109459#2990186 <https://reviews.llvm.org/D109459#2990186>, @Quuxplusone wrote:

> FWLIW, I'm generally in favor of this. Although I think it's ironic that we //already had// an ABI flag for this, such that we'd have gotten this change for free if we ever managed to reach ABIv2. Feels like this PR is the most public admission yet that we'll never actually be able to reach `std::__2`.

I don't think that's accurate. IMO, there are things we need to guard behind an ABI flag because they would actually break people and cause problems if we did not. Then there are things (like this `nullptr_t` emulation) that wouldn't break anyone anyways if we turned it on, so we might as well do it in the ABI v1 (proof is needed regarding whether I'm right about that, and I'm running builds to check that out right now).

IMO, the idea of an ABI v2 is a bit funky, I think we need to define it better. I think something more useful would be to formalize how different platforms get to select different ABI flags, since "breaking" the ABI is easiest done when one introduces a new platform. That doesn't happen super often, but it's better than nothing. Anyway, this is a discussion for a different forum.



================
Comment at: libcxx/include/cstddef:46
 
+using ::nullptr_t _LIBCPP_USING_IF_EXISTS;
 using ::ptrdiff_t _LIBCPP_USING_IF_EXISTS;
----------------
Quuxplusone wrote:
> Surely this should just unconditionally say `typedef decltype(nullptr) nullptr_t;` — why would we ever //not// want `std::nullptr_t` to exist?
> (Vice versa, personally I don't understand why we define a type named `::nullptr_t`; but I assume there's some good reason not to remove it now.)
Sure, I can drop `_LIBCPP_USING_IF_EXISTS` here since it's always defined (by us).

Regarding `::nullptr_t`, I was surprised to read that `<stddef.h>` is supposed to provide such a type 🤷🏼‍♂️.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109459



More information about the libcxx-commits mailing list