2121#include < __memory/allocator_traits.h>
2222#include < __memory/construct_at.h>
2323#include < __memory/pointer_traits.h>
24+ #include < __memory/voidify.h>
2425#include < __type_traits/enable_if.h>
2526#include < __type_traits/extent.h>
2627#include < __type_traits/is_array.h>
@@ -63,7 +64,7 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
6364 try {
6465#endif
6566 for (; __ifirst != __ilast && !__stop_copying (__idx); ++__ifirst, (void )++__idx)
66- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType (*__ifirst);
67+ ::new (std::__voidify (*__idx)) _ValueType (*__ifirst);
6768#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
6869 } catch (...) {
6970 std::__destroy (__ofirst, __idx);
@@ -93,7 +94,7 @@ __uninitialized_copy_n(_InputIterator __ifirst, _Size __n, _ForwardIterator __of
9394 try {
9495#endif
9596 for (; __n > 0 && !__stop_copying (__idx); ++__ifirst, (void )++__idx, (void )--__n)
96- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType (*__ifirst);
97+ ::new (std::__voidify (*__idx)) _ValueType (*__ifirst);
9798#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
9899 } catch (...) {
99100 std::__destroy (__ofirst, __idx);
@@ -123,7 +124,7 @@ __uninitialized_fill(_ForwardIterator __first, _Sentinel __last, const _Tp& __x)
123124 try {
124125#endif
125126 for (; __idx != __last; ++__idx)
126- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType (__x);
127+ ::new (std::__voidify (*__idx)) _ValueType (__x);
127128#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
128129 } catch (...) {
129130 std::__destroy (__first, __idx);
@@ -151,7 +152,7 @@ __uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) {
151152 try {
152153#endif
153154 for (; __n > 0 ; ++__idx, (void )--__n)
154- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType (__x);
155+ ::new (std::__voidify (*__idx)) _ValueType (__x);
155156#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
156157 } catch (...) {
157158 std::__destroy (__first, __idx);
@@ -181,7 +182,7 @@ __uninitialized_default_construct(_ForwardIterator __first, _Sentinel __last) {
181182 try {
182183# endif
183184 for (; __idx != __last; ++__idx)
184- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType;
185+ ::new (std::__voidify (*__idx)) _ValueType;
185186# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
186187 } catch (...) {
187188 std::__destroy (__first, __idx);
@@ -207,7 +208,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_default_construct_
207208 try {
208209# endif
209210 for (; __n > 0 ; ++__idx, (void )--__n)
210- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType;
211+ ::new (std::__voidify (*__idx)) _ValueType;
211212# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
212213 } catch (...) {
213214 std::__destroy (__first, __idx);
@@ -234,7 +235,7 @@ __uninitialized_value_construct(_ForwardIterator __first, _Sentinel __last) {
234235 try {
235236# endif
236237 for (; __idx != __last; ++__idx)
237- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType ();
238+ ::new (std::__voidify (*__idx)) _ValueType ();
238239# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
239240 } catch (...) {
240241 std::__destroy (__first, __idx);
@@ -260,7 +261,7 @@ inline _LIBCPP_HIDE_FROM_ABI _ForwardIterator __uninitialized_value_construct_n(
260261 try {
261262# endif
262263 for (; __n > 0 ; ++__idx, (void )--__n)
263- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType ();
264+ ::new (std::__voidify (*__idx)) _ValueType ();
264265# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
265266 } catch (...) {
266267 std::__destroy (__first, __idx);
@@ -296,7 +297,7 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
296297 try {
297298# endif
298299 for (; __ifirst != __ilast && !__stop_moving (__idx); ++__idx, (void )++__ifirst) {
299- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType (__iter_move (__ifirst));
300+ ::new (std::__voidify (*__idx)) _ValueType (__iter_move (__ifirst));
300301 }
301302# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
302303 } catch (...) {
@@ -334,7 +335,7 @@ inline _LIBCPP_HIDE_FROM_ABI pair<_InputIterator, _ForwardIterator> __uninitiali
334335 try {
335336# endif
336337 for (; __n > 0 && !__stop_moving (__idx); ++__idx, (void )++__ifirst, --__n)
337- ::new (static_cast < void *>( std::addressof (*__idx) )) _ValueType (__iter_move (__ifirst));
338+ ::new (std::__voidify (*__idx)) _ValueType (__iter_move (__ifirst));
338339# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
339340 } catch (...) {
340341 std::__destroy (__ofirst, __idx);
0 commit comments