AK: Add abstraction for forcing empty base optimization on Windows

Without this annotation, the MSVC ABI is reluctant to apply EBO even
in cases that are basically guaranteed on the Itanium ABI by modern
compilers. This fixes an UBSAN issue with Variant on Windows.
This commit is contained in:
ayeteadoe 2025-06-16 15:08:50 -06:00 committed by Andrew Kaster
commit 3fd05306fc
Notes: github-actions[bot] 2025-06-17 21:35:02 +00:00
3 changed files with 10 additions and 3 deletions

View file

@ -478,7 +478,7 @@ private:
}
template<typename... Fs>
struct Visitor : Fs... {
struct AK_COMPACT_EMPTY_BASES Visitor : Fs... {
using Types = TypeList<Fs...>;
Visitor(Fs&&... args)