Skip to content

Commit c0c2f02

Browse files
[libc++] Silent warning related to memcpy of non trivially-copyable data
1 parent 9b01d53 commit c0c2f02

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libcxx/include/__iterator/aliasing_iterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper {
102102

103103
_LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT {
104104
_Alias __val;
105-
__builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type));
105+
__builtin_memcpy(&__val, static_cast<const void*>(std::__to_address(__base_)), sizeof(value_type));
106106
return __val;
107107
}
108108

libcxx/include/__memory/uninitialized_algorithms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _
638638
__guard.__complete();
639639
std::__allocator_destroy(__alloc, __first, __last);
640640
} else {
641-
__builtin_memcpy(__result, __first, sizeof(_Tp) * (__last - __first));
641+
__builtin_memcpy((void*)__result, (void*)__first, sizeof(_Tp) * (__last - __first));
642642
}
643643
}
644644

0 commit comments

Comments
 (0)