[libcxx-commits] [PATCH] D120064: Fix EBO on std::optional and std::variant when targeting the MSVC ABI

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 1 05:31:17 PST 2022


ldionne requested changes to this revision.
ldionne added a subscriber: mstorsjo.
ldionne added a comment.
This revision now requires changes to proceed.

In D120064#3329840 <https://reviews.llvm.org/D120064#3329840>, @jdoerrie wrote:

> Hi both, PTAL. I was surprised to find out that both `std::variant<int>` and `std::optional<int>` have a sizeof 12 in my environment, this is my attempt to fix it. Please do let me know if there are other places I need to change, or how I would write a test to prevent future regressions.

This is an ABI break on Windows, pinging @mstorsjo.

Regarding writing a test, you can add one in the appropriate subdirectory of `libcxx/test/libcxx` so we only check the property when testing libc++ itself, not other standard library implementations.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120064/new/

https://reviews.llvm.org/D120064



More information about the libcxx-commits mailing list