fix: replace deprecated std::aligned_storage_t (C++23 STL4034)#43
Conversation
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) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 50 minutes and 14 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
std::aligned_storage/std::aligned_storage_tare deprecated in C++23. The updated MSVC STL (rolling out on GitHub'swindows-latest→windows-2025-vs2026runners) now emits C4996 / STL4034 for the_storagemember inRE::msvc::function(RE/msvc/functional.h:42).This breaks every downstream consumer that compiles CommonLibF4 with warnings-as-errors. For example, Buffout4 sets
/WXglobally and its release build now fails:Fix
Replace
std::aligned_storage_t<3 * sizeof(void*), alignof(long double)>with the MSVC-recommendedalignas(long double) std::byte _storage[3 * sizeof(void*)].The storage is byte-identical: 24 bytes, aligned to
alignof(long double)(8), with_fnstill at offset0x18. The ABI mirror ofstd::_Func_classis unchanged.std::byteis already provided via the library PCH (<cstddef>).🤖 Generated with Claude Code