Re:Clang emits memcpy for std::swap, which can introduce und...
by whitequark_ on Sunday April 24, 2016 @09:06PM
(#11562059)
The bug report is not wrong. Rather, whether the current behavior is correct depends on the platform.
For example, Darwin's libc offers this contract for memcpy and clang is perfectly within its rights to generate such code (note that the IR it generates is still violating LLVM's contract on the memcpy intrinsic); glibc offers no such contract for memcpy, and so clang's code is nonconformant.
My first post is generic and not about this particular issue; it's still fine.