[libcxx-commits] [libcxx] [libc++] Avoid non-trivial assignment in `__uninitialized_allocator_copy_impl` (PR #196648)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 16 10:28:19 PDT 2026


================
@@ -491,7 +491,7 @@ template <class _Alloc,
                             __allocator_has_trivial_copy_construct_v<_Alloc, _In>,
                         int> = 0>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Out*
-__uninitialized_allocator_copy_impl(_Alloc&, _In* __first1, _In* __last1, _Out* __first2) {
+__uninitialized_allocator_copy_impl(_Alloc&, const _In* __first1, const _In* __last1, _Out* __first2) {
----------------
philnik777 wrote:

Actually, does this get called with non-const pointers? I think the other overload may be a better match now for that case, which would be quite unfortunate.

Sorry that I didn't think about this before.

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


More information about the libcxx-commits mailing list