[libcxx-commits] [libcxx] 5c3befb - [libc++] Add forgotten call to std::__to_address in __uninitialized_allocator_relocate

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 14 05:08:06 PST 2024


Author: Louis Dionne
Date: 2024-11-14T14:07:57+01:00
New Revision: 5c3befb91cd774161e5d700cf2c351d42d29927c

URL: https://github.com/llvm/llvm-project/commit/5c3befb91cd774161e5d700cf2c351d42d29927c
DIFF: https://github.com/llvm/llvm-project/commit/5c3befb91cd774161e5d700cf2c351d42d29927c.diff

LOG: [libc++] Add forgotten call to std::__to_address in __uninitialized_allocator_relocate

Added: 
    

Modified: 
    libcxx/include/__memory/uninitialized_algorithms.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h
index 3960ab6d84dba7..71c7ed94fec13e 100644
--- a/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__memory/uninitialized_algorithms.h
@@ -631,9 +631,9 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __uninitialized_allocat
     auto __iter = __first;
     while (__iter != __last) {
 #if _LIBCPP_HAS_EXCEPTIONS
-      allocator_traits<_Alloc>::construct(__alloc, __result, std::move_if_noexcept(*__iter));
+      allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__result), std::move_if_noexcept(*__iter));
 #else
-      allocator_traits<_Alloc>::construct(__alloc, __result, std::move(*__iter));
+      allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__result), std::move(*__iter));
 #endif
       ++__iter;
       ++__result;


        


More information about the libcxx-commits mailing list