diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h index c0bc30c7450fe..49e0e8ab0db40 100644 --- a/llvm/include/llvm/ADT/FunctionExtras.h +++ b/llvm/include/llvm/ADT/FunctionExtras.h @@ -161,8 +161,7 @@ template class UniqueFunctionBase { // provide three pointers worth of storage here. // This is mutable as an inlined `const unique_function` may // still modify its own mutable members. - mutable std::aligned_storage_t - InlineStorage; + alignas(void *) mutable std::byte InlineStorage[InlineStorageSize]; } StorageUnion; // A compressed pointer to either our dispatching callback or our table of diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp index f9f1b8a419b82..9b09384e95bfe 100644 --- a/llvm/lib/Support/PrettyStackTrace.cpp +++ b/llvm/lib/Support/PrettyStackTrace.cpp @@ -143,10 +143,9 @@ static void setCrashLogMessage(const char *msg) { #ifdef __APPLE__ using CrashHandlerString = SmallString<2048>; -using CrashHandlerStringStorage = - std::aligned_storage::type; -static CrashHandlerStringStorage crashHandlerStringStorage; +using CrashHandlerStringStorage = std::byte[sizeof(CrashHandlerString)]; +alignas(CrashHandlerString) static CrashHandlerStringStorage + crashHandlerStringStorage; #endif /// This callback is run if a fatal signal is delivered to the process, it