Index: llvm/trunk/include/llvm/Support/JSON.h =================================================================== --- llvm/trunk/include/llvm/Support/JSON.h +++ llvm/trunk/include/llvm/Support/JSON.h @@ -452,7 +452,10 @@ new (reinterpret_cast(Union.buffer)) T(std::forward(V)...); } template T &as() const { - return *reinterpret_cast(Union.buffer); + // Using this two-step static_cast via void * instead of reinterpret_cast + // silences a -Wstrict-aliasing false positive from GCC6 and earlier. + void *Storage = static_cast(Union.buffer); + return *static_cast(Storage); } template