diff --git a/compiler-rt/lib/orc/error.h b/compiler-rt/lib/orc/error.h index e64332e9ae76..28035095b692 100644 --- a/compiler-rt/lib/orc/error.h +++ b/compiler-rt/lib/orc/error.h @@ -367,8 +367,8 @@ private: } union { - std::aligned_union_t<1, storage_type> TStorage; - std::aligned_union_t<1, error_type> ErrorStorage; + alignas(storage_type) char TStorage[sizeof(storage_type)]; + alignas(error_type) char ErrorStorage[sizeof(error_type)]; }; bool HasError : 1; diff --git a/llvm/include/llvm/ADT/TrieRawHashMap.h b/llvm/include/llvm/ADT/TrieRawHashMap.h index 5bfe5c9e6a0f..e312967edeb5 100644 --- a/llvm/include/llvm/ADT/TrieRawHashMap.h +++ b/llvm/include/llvm/ADT/TrieRawHashMap.h @@ -72,7 +72,7 @@ public: private: template struct AllocValueType { char Base[TrieContentBaseSize]; - std::aligned_union_t Content; + alignas(T) char Content[sizeof(T)]; }; protected: