[libcxx-commits] [libcxx] [libcxx] makes `expected` trivially assignable when both members are … (PR #74768)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 16 14:00:54 PST 2024


ldionne wrote:

> @cjdb It would be great to land this before the release branch to get the ABI breaks into a single release.

I actually considered the ABI aspect of this before, and I concluded that this wasn't ABI breaking since only trivial constructibility is taken into account for being trivial-for-the-purpose-of-ABI. From the [Itanium C++ ABI](https://itanium-cxx-abi.github.io/cxx-abi/abi.html#definitions):

> _non-trivial for the purposes of calls_
> A type is considered non-trivial for the purposes of calls if:
>
> - it has a non-trivial copy constructor, move constructor, or destructor, or
> - all of its copy and move constructors are deleted.
>
> This definition, as applied to class types, is intended to be the complement of the definition in [class.temporary]p3 of types for which an extra temporary is allowed when passing or returning a type. A type which is trivial for the purposes of the ABI will be passed and returned according to the rules of the base C ABI, e.g. in registers; often this has the effect of performing a trivial copy of the type.

Am I wrong? If this is an ABI break, we have to consider it way more carefully than I thought and TBH I think the LWG issue will probably come back as NAD.

https://github.com/llvm/llvm-project/pull/74768


More information about the libcxx-commits mailing list