From 4b2eaf4ff1b6d29e3f84d6b27fdde288c48c98a9 Mon Sep 17 00:00:00 2001 From: LLVM Packaging Team Date: Sun, 16 Dec 2018 12:07:54 +0000 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