From ed423ffbe46ce3e2215966852a710b968e9df2b4 Mon Sep 17 00:00:00 2001 From: LLVM Packaging Team Date: Tue, 9 Jul 2019 20:04:39 +0100 Subject: [PATCH] pr39427-misscompile =================================================================== Gbp-Pq: Name pr39427-misscompile.diff --- include/llvm/ADT/Optional.h | 18 ------------------ 1 file changed, 18 deletions(-) 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 { -- 2.30.2