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

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 3 09:54:03 PDT 2026


================
@@ -740,14 +757,14 @@ class vector {
 
   struct _ConstructTransaction {
     _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(vector& __v, size_type __n)
-        : __v_(__v), __pos_(__v.__end_), __new_end_(__v.__end_ + __n) {
+        : __v_(__v), __pos_(__v.__layout_.__end_ptr()), __new_end_(__pos_ + __n) {
       __v_.__annotate_increase(__n);
     }
 
     _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() {
-      __v_.__end_ = __pos_;
+      __v_.__layout_.__set_boundary(__pos_);
----------------
ldionne wrote:

```suggestion
      __v_.__layout_.__set_end(__pos_);
```

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


More information about the libcxx-commits mailing list