From ead602b8382068b5f69e61289afee5cbb9a60d0e Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 27 Jul 2026 17:13:09 -0700 Subject: [PATCH] Remove use of std::aligned_storage. NFC This is deprecated in C++23. See https://github.com/llvm/llvm-project/pull/94169 This also allows us to remove the `/D_ENABLE_EXTENDED_ALIGNED_STORAGE` from `CMakeLists.txt` which was originally added back in e8ac331501. Back then we also used in this in `src/mixed_arena.h` but that usage was removed in #1846. --- CMakeLists.txt | 3 --- third_party/llvm-project/include/llvm/ADT/FunctionExtras.h | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41e1ec45a02..7dd0d914ad6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,9 +250,6 @@ if(MSVC) # workaround for https://github.com/WebAssembly/binaryen/issues/3661 add_compile_flag("/D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING") - # Visual Studio 2018 15.8 implemented conformant support for std::aligned_storage, but the conformant support is only enabled when the following flag is passed, to avoid - # breaking backwards compatibility with code that relied on the non-conformant behavior (the old nonconformant behavior is not used with Binaryen) - add_compile_flag("/D_ENABLE_EXTENDED_ALIGNED_STORAGE") # Don't warn about using "strdup" as a reserved name. add_compile_flag("/D_CRT_NONSTDC_NO_DEPRECATE") diff --git a/third_party/llvm-project/include/llvm/ADT/FunctionExtras.h b/third_party/llvm-project/include/llvm/ADT/FunctionExtras.h index 121aa527a5d..48a291f1945 100644 --- a/third_party/llvm-project/include/llvm/ADT/FunctionExtras.h +++ b/third_party/llvm-project/include/llvm/ADT/FunctionExtras.h @@ -112,8 +112,7 @@ class unique_function { // For in-line storage, we just provide an aligned character buffer. We // provide three pointers worth of storage here. - typename std::aligned_storage::type - InlineStorage; + alignas(void *) mutable std::byte InlineStorage[InlineStorageSize]; } StorageUnion; // A compressed pointer to either our dispatching callback or our table of