[libcxx-commits] [libcxx] [libc++] Make std::pair trivially copyable if its members are (PR #89652)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jun 5 13:40:40 PDT 2024
EricWF wrote:
@ldionne
> This is only the tip of the iceberg and since we can easily find a few things that get broken by this
I tried really hard to create a compilable & runnable ABI break for this change (without referencing `is_trivially_copyable` myself), and I was unable.
Could you say a little bit more about the breakages you see?
It's worth noting that we've _been shipping an ABI break_ in pair since v15.0.0, where `is_trivially_copyable<pair<T, U>>` is always false in C++23, but not before that. The fact that nobody's noticed might help us inform the decision.
Either way I'm happy with either direction. Though not handling this an an ABI break does make the source a lot more maintainable.
Regarding Stable vs Unstable
========================
If my memory serves me, we initially had a distinction between:
* `_LIBCPP_ABI_VERSION == <N>`, and
* `_LIBCPP_ABI_UNSTABLE`
The latter was removed at some point, making it equivalent to `_LIBCPP_ABI_VERSION == <N>` for the newest `N`.
It think we should consider adding it back.
There are library improvements we can make that are inherently unstable. And there are one-time ABI breaking improvements. In order to support both types, we need the distinction. And it comes at essentially no cost over the status quo.
https://github.com/llvm/llvm-project/pull/89652
More information about the libcxx-commits
mailing list