From 67dce272e3a237716d503c67b7363b638ea9f634 Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Mon, 1 Jun 2026 22:57:24 -0700 Subject: [PATCH] fix: replace deprecated std::aligned_storage_t (C++23 STL4034) std::aligned_storage and std::aligned_storage_t are deprecated in C++23. Under the updated MSVC STL, C4996/STL4034 fires for the _storage member in RE::msvc::function, which breaks downstream builds that treat warnings as errors (e.g. Buffout4's /WX). Replace it with the MSVC-recommended `alignas(T) std::byte buf[N]` form. The layout is identical: 24 bytes aligned to alignof(long double), so the ABI mirror of std::_Func_class is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- CommonLibF4/include/RE/msvc/functional.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CommonLibF4/include/RE/msvc/functional.h b/CommonLibF4/include/RE/msvc/functional.h index 0c63f88d..c4fcdfda 100644 --- a/CommonLibF4/include/RE/msvc/functional.h +++ b/CommonLibF4/include/RE/msvc/functional.h @@ -39,7 +39,8 @@ namespace RE::msvc [[nodiscard]] bool good() const noexcept { return _fn != nullptr; } - std::aligned_storage_t<3 * sizeof(void*), alignof(long double)> _storage; // 00 - proxy_t* _fn; // 18 + // std::aligned_storage[_t] is deprecated in C++23; use the recommended alignas byte buffer instead. + alignas(long double) std::byte _storage[3 * sizeof(void*)]; // 00 + proxy_t* _fn; // 18 }; }