[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
Mon Nov 29 13:25:13 PST 2021


ldionne added a comment.

In D109459#3159309 <https://reviews.llvm.org/D109459#3159309>, @dexonsmith wrote:

> In D109459#3043589 <https://reviews.llvm.org/D109459#3043589>, @ldionne wrote:
>
>> @dexonsmith has had useful views on ABI changes in the past, I'm curious to have his opinion on this change, since I'm still ambivalent.
>
> I missed this before!
>
>> TL;DR: Today, `std::nullptr_t` is a different type in C++03 and C++11, which means that the ABI breaks between C++03 and C++11. This patch breaks the ABI in C++03 mode once, right now, to reconcile the C++03 and C++11 ABIs and remove some convolution from libc++. My hunch is that this will not affect too many people and hence it's reasonable. Remember that `nullptr` is a C++11 construct, so it would have to be someone compiling their code in C++03 mode *and* using our `nullptr` extension, *and* leaking `nullptr_t` in their ABI. Do you have an opinion?
>
> This feels relatively safe to me for the reasons given, but hard to be sure. One option would be to change behaviour behind a vendor+user macro combo for a couple of releases to test (vendors and/or users could revert to behaviour as-is today if/when necessary), then drop the configurations once there’s more confidence. I’m not sure it’s worth the trouble though.

Thanks for chiming in. I like this a lot. I will repurpose this patch to enable the ABI break by default while still letting users return to the previous behavior by defining a macro. After shipping that for one release, we can rip it out entirely if there aren't widespread issues reported.


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