[libcxx-commits] [PATCH] D145587: [libc++] Remove symbols for a std::allocator_arg & friends from the dylib

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 8 10:56:52 PST 2023


Mordante accepted this revision as: Mordante.
Mordante added a comment.

In D145587#4178293 <https://reviews.llvm.org/D145587#4178293>, @ldionne wrote:

> For reviewers -- note that we could technically keep defining those symbols in the dylib. I could define a `.cpp` file with something like
>
>   struct defer_lock_t { explicit defer_lock_t() = default; };
>   struct try_to_lock_t { explicit try_to_lock_t() = default; };
>   struct adopt_lock_t { explicit adopt_lock_t() = default; };
>   
>   const defer_lock_t  defer_lock{};
>   const try_to_lock_t try_to_lock{};
>   const adopt_lock_t  adopt_lock{};
>   
>   // etc... for others

It would still be possible if we make this an extra library, which uses can link to manually, or automatically when invoking clang with `std=c++98 -stdlib=libc++`. (In a similar fashion we do for the experimental library.)

Note that is something we can do, I'm not convinced we should. However when we want to go that route we can look at more C++03 extensions that can be done in the same fashion. However whether or not that is wanted/needed is up to the vendors.

The code changes itself LGTM!



================
Comment at: libcxx/lib/abi/CHANGELOG.TXT:25
+  extension, and in C++03 it was impossible to define them as `constexpr`
+  variables, like in the spec.
+
----------------



================
Comment at: libcxx/lib/abi/CHANGELOG.TXT:28
+  This is technically an ABI break since we are removing symbols from the
+  library. However, in practice, only programs compiled in C++03 mode who
+  take the address of those objects (or pass them as a reference) will have
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145587



More information about the libcxx-commits mailing list