pr39427-misscompile
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sun, 16 Dec 2018 12:07:54 +0000 (12:07 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Sun, 16 Dec 2018 12:07:54 +0000 (12:07 +0000)
===================================================================

Gbp-Pq: Name pr39427-misscompile.diff

include/llvm/ADT/Optional.h

index 353e5d0ec9df20c7ddaffd821f10ffefa45b08c7..9fe9b2824ad61c04903477d29543f21db0e0591a 100644 (file)
@@ -108,24 +108,6 @@ template <typename T, bool IsPodLike> struct OptionalStorage {
   }
 };
 
-#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
-/// Storage for trivially copyable types only.
-template <typename T> struct OptionalStorage<T, true> {
-  AlignedCharArrayUnion<T> storage;
-  bool hasVal = false;
-
-  OptionalStorage() = default;
-
-  OptionalStorage(const T &y) : hasVal(true) { new (storage.buffer) T(y); }
-  OptionalStorage &operator=(const T &y) {
-    *reinterpret_cast<T *>(storage.buffer) = y;
-    hasVal = true;
-    return *this;
-  }
-
-  void reset() { hasVal = false; }
-};
-#endif
 } // namespace optional_detail
 
 template <typename T> class Optional {