From 59dfc43949d37446889126761be76b26d59a174c Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Thu, 9 Jun 2022 22:53:47 +0100 Subject: [PATCH] Common: replace std::aligned_storage_t with alignas C++23 deprecates std::aligned_storage_t while alignas works since C++11. This fixes issue 12925. --- Source/Core/Common/BitUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/BitUtils.h b/Source/Core/Common/BitUtils.h index 09ab4bd78c..1934809e21 100644 --- a/Source/Core/Common/BitUtils.h +++ b/Source/Core/Common/BitUtils.h @@ -201,7 +201,7 @@ inline To BitCast(const From& source) noexcept static_assert(std::is_trivially_copyable(), "BitCast destination type must be trivially copyable."); - std::aligned_storage_t storage; + alignas(To) std::byte storage[sizeof(To)]; std::memcpy(&storage, &source, sizeof(storage)); return reinterpret_cast(storage); }