From: LLVM Packaging Team Date: Sun, 16 Dec 2018 12:07:54 +0000 (+0000) Subject: pr39427-misscompile X-Git-Tag: archive/raspbian/1%7.0.1-1+rpi1^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4b2eaf4ff1b6d29e3f84d6b27fdde288c48c98a9;p=llvm-toolchain-7.git pr39427-misscompile =================================================================== Gbp-Pq: Name pr39427-misscompile.diff --- diff --git a/include/llvm/ADT/Optional.h b/include/llvm/ADT/Optional.h index 353e5d0ec..9fe9b2824 100644 --- a/include/llvm/ADT/Optional.h +++ b/include/llvm/ADT/Optional.h @@ -108,24 +108,6 @@ template struct OptionalStorage { } }; -#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this. -/// Storage for trivially copyable types only. -template struct OptionalStorage { - AlignedCharArrayUnion storage; - bool hasVal = false; - - OptionalStorage() = default; - - OptionalStorage(const T &y) : hasVal(true) { new (storage.buffer) T(y); } - OptionalStorage &operator=(const T &y) { - *reinterpret_cast(storage.buffer) = y; - hasVal = true; - return *this; - } - - void reset() { hasVal = false; } -}; -#endif } // namespace optional_detail template class Optional {