diff options
Diffstat (limited to 'libcxx/docs/ReleaseNotes/18.rst')
-rw-r--r-- | libcxx/docs/ReleaseNotes/18.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst index 7d6331a..c619f94 100644 --- a/libcxx/docs/ReleaseNotes/18.rst +++ b/libcxx/docs/ReleaseNotes/18.rst @@ -284,6 +284,28 @@ ABI Affecting Changes against different configurations of it being used in different translation units. +- The amount of padding bytes available for use at the end of certain ``std::expected`` instantiations has changed in this + release. This is an ABI break for any code that held a ``std::expected`` member with ``[[no_unique_address]]`` in an + ABI-facing type. In those cases, the layout of the enclosing type will change, breaking the ABI. However, the + ``std::expected<T, E>`` member requires a few characteristics in order to be affected by this change: + + - A type equivalent to ``union {T ; E}`` needs to have more than one byte of padding available. + - The ``std::expected<T, E>`` member must have been in a situation where its padding bytes were previously reused by + another object, which can happen in a few cases (this is probably not exhaustive): + + - It is a member with ``[[no_unique_address]]`` applied to it, and it is followed by another data member, or + - It is a member with ``[[no_unique_address]]`` applied to it, and it is the last member of the user-defined type, + and that user-defined type is used in ways that its padding bytes can be reused, or + - It is inherited from + + We expect that this will not be a very frequent occurrence. However, there is unfortunately no technique we can use + in the library to catch such misuse. Indeed, even applying an ABI tag to ``std::expected`` would not help since ABI + tags are not propagated to containing types. As a result, if you notice very difficult to explain bugs around the + usage of a ``std::expected``, you should consider checking whether you are hitting this ABI break. This change was + done to fix `#70494 <https://github.com/llvm/llvm-project/issues/70494>`_ and the vendor communication is handled + in `#70820 <https://github.com/llvm/llvm-project/issues/70820>`_. + + Build System Changes -------------------- |