[clang] [compiler-rt] [libcxx] [llvm] [clang] Warn about memset/memcpy to NonTriviallyCopyable types (PR #111434)

Carlos Galvez via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 01:25:41 PDT 2024


================
@@ -102,7 +102,7 @@ struct __aliasing_iterator_wrapper {
 
     _LIBCPP_HIDE_FROM_ABI _Alias operator*() const _NOEXCEPT {
       _Alias __val;
-      __builtin_memcpy(&__val, std::__to_address(__base_), sizeof(value_type));
+      __builtin_memcpy(&__val, static_cast<const void*>(std::__to_address(__base_)), sizeof(value_type));
----------------
carlosgalvezp wrote:

@serge-sans-paille Sounds like this requires some extra investigation, which may be holding your patch for longer time than wanted. Would it make more sense to remove all the "silence warning" changes from this patch and focus only on getting the warning in?

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


More information about the cfe-commits mailing list