[libcxx-commits] [libcxx] [libc++] Replace `__compressed_pair` with `[[no_unique_address]]` (PR #76756)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 5 09:28:06 PDT 2024


================
@@ -143,7 +143,7 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
       void>;
 
 private:
-  __compressed_pair<pointer, deleter_type> __ptr_;
+  _LIBCPP_COMPRESSED_PAIR(pointer, __ptr_, deleter_type, __deleter_);
----------------
ldionne wrote:

Since we know the before and after layout, we could issue a diagnostic (`static_assert`) statically when we have an ABI break. We would provide an opt-out for users to disable the error if they don't care about the breakage. We would remove that diagnostic in LLVM 21, giving one release for users to figure out what to do if they're affected.

Can you look into this and we can run it through a large code base to get a bit more information about the potential unintended impact of this change.

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


More information about the libcxx-commits mailing list