[libcxx-commits] [libcxx] [libc++][ABI BREAK] Make std::pair trivially copyable if its members are (PR #89652)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 25 09:24:59 PDT 2024


================
@@ -32,6 +32,7 @@
 #include <__type_traits/is_implicitly_default_constructible.h>
----------------
ldionne wrote:

This needs an ABI flag. We discussed it a bunch during our live review, but basically I think this is too tricky to land without an ABI flag.

In itself, we're only changing whether `std::pair` is trivially copy/move assignable. However, that causes it to become TriviallyCopyable, and in turn that property is used in various places. For example, Folly's `Expected` uses that to determine what kind of storage they'll use internally: https://sourcegraph.com/github.com/facebook/folly@a615f664d59ecbd317817a2c045cf25fb8389b08/-/blob/folly/Expected.h?L285:22-285:48

There's other examples and it's easy to imagine other places depending on it. Since `std::pair` is extremely widespread, I think it's too dangerous to make this change without an ABI flag.

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


More information about the libcxx-commits mailing list