The current code is casting pointer to a misaligned type which is undefined behavior.
Found by compiling with Undefined Behavior Sanitizer and running tests (check-clang-tools).
AFAIK clang produces the same code for reinterpret_cast<>() and memcpy().
Follow-up to: https://reviews.llvm.org/D44575