diff options
author | Eric Fiselier <eric@efcs.ca> | 2023-04-27 21:04:04 -0400 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2023-04-27 21:04:04 -0400 |
commit | db381405ced7b65ad1cf8fc60bbdfb505e1ed3de (patch) | |
tree | 874e935e2500cb1d1def96e072446ab71e8d4301 /libcxx/docs | |
parent | 47f72aede163348ee474be4a3004dc0a9195fa9c (diff) | |
download | llvm-db381405ced7b65ad1cf8fc60bbdfb505e1ed3de.tar.gz |
Fix EBO on std::optional and std::variant when targeting the MSVC ABI
Committing on behalf of davidben. Reviewed as D146190
Patch originally by Jan Dörrie in https://reviews.llvm.org/D120064. I've just updated it to include tests, and update documentation that MSVC ABI is not stable.
In the current implementation both `std::optional` and `std::variant` don't perform the EBO on MSVC's ABI. This is because both classes inherit from multiple empty base classes, which breaks the EBO for MSVC. This patch fixes this issue by applying the `empty_bases` declspec attribute, which is already used to fix a similar issue for `std::tuple`.
See https://reviews.llvm.org/D120064 for discussion on MSVC ABI stability. From the discussion, libc++ doesn't have users that expect a stable ABI on MSVC. The fix is thus applied unconditionally to benefit more users. Documentation has been updated to reflect this.
Fixes https://github.com/llvm/llvm-project/issues/61095.
Diffstat (limited to 'libcxx/docs')
-rw-r--r-- | libcxx/docs/DesignDocs/ABIVersioning.rst | 8 | ||||
-rw-r--r-- | libcxx/docs/index.rst | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/libcxx/docs/DesignDocs/ABIVersioning.rst b/libcxx/docs/DesignDocs/ABIVersioning.rst index 3b82f3cc60a4..ad7218687d55 100644 --- a/libcxx/docs/DesignDocs/ABIVersioning.rst +++ b/libcxx/docs/DesignDocs/ABIVersioning.rst @@ -22,3 +22,11 @@ Internally, each ABI-changing feature is placed under its own C++ macro, ``_LIBCPP_ABI_VERSION``, which is controlled by the ``LIBCXX_ABI_VERSION`` set at build time. Libc++ does not intend users to interact with these C++ macros directly. + +----------------- +MSVC environments +----------------- + +The exception to this is MSVC environments. Libc++ does not currently have users +that require a stable ABI in MSVC environments, so MSVC-only changes may be +applied unconditionally. diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst index be89c177db3f..6fa35d4ed40e 100644 --- a/libcxx/docs/index.rst +++ b/libcxx/docs/index.rst @@ -120,7 +120,7 @@ Target platform Target architecture Notes macOS 10.9+ i386, x86_64, arm64 Building the shared library itself requires targetting macOS 10.13+ FreeBSD 12+ i386, x86_64, arm Linux i386, x86_64, arm, arm64 Only glibc-2.24 and later and no other libc is officially supported -Windows i386, x86_64 Both MSVC and MinGW style environments +Windows i386, x86_64 Both MSVC and MinGW style environments, ABI in MSVC environments is :doc:`unstable <DesignDocs/ABIVersioning>` AIX 7.2TL5+ powerpc, powerpc64 =============== ========================= ============================ |