================
@@ -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));
----------------
philnik777 wrote:
I think the part that gives inspecting an object well-defined behaviour is
http://eel.is/c++draft/basic.types#general-4. I'm not 100% sure, though. There
might be something more explicit (I was hoping someone here knows).
https://eel.is/c++draft/cstring.syn#3 also states that "[The `memcpy` and
`memmove`] functions implicitly create objects
([[intro.object]](https://eel.is/c++draft/intro.object)) in the destination
region of storage immediately prior to copying the sequence of characters to
the destination", which sounds to me a lot like it's allowed to copy the bytes
_from_ anywhere.
https://github.com/llvm/llvm-project/pull/111434
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits