Skip to content

libc++ std::variant adds two words of overhead, rather than one, on Windows #61095

@davidben

Description

@davidben

I don't have an easy standalone reproducer, mostly because I don't see clang-cl on godbolt or anything, but here's a static_assert in Chromium:
https://chromium-review.googlesource.com/c/chromium/src/+/4294508
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8787813272405926289/+/u/compile__with_patch_/stdout

While absl::variant<size_t, char> is 16 bytes as expected, std::variant<size_t, char>, on just Windows is 24 bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions