[libcxx-commits] [libcxx] [libcxx] adds a size-based representation for `vector`'s unstable ABI (PR #155330)

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 11 00:36:12 PST 2026


================
@@ -977,22 +979,19 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI vector<_Tp, _Allocato
 #else
     _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
 #endif
-    : __alloc_(std::move(__x.__alloc_)) {
-  this->__begin_ = __x.__begin_;
-  this->__end_   = __x.__end_;
-  this->__cap_   = __x.__cap_;
-  __x.__begin_ = __x.__end_ = __x.__cap_ = nullptr;
+    : __base_type(std::move(__x.__alloc())) {
+  __set_valid_range(__x.__begin_ptr(), __x.__boundary_representation());
+  __set_capacity(__x.__capacity_representation());
+  __x.__set_valid_range(nullptr, static_cast<size_type>(0));
+  __x.__set_capacity(static_cast<size_type>(0));
----------------
cjdb wrote:

Done.

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


More information about the libcxx-commits mailing list