https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69560

--- Comment #25 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:ac8c61b62e71ffdcaebfd4cfc03f58fe542855dd

commit r15-1713-gac8c61b62e71ffdcaebfd4cfc03f58fe542855dd
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Jun 26 12:40:51 2024 +0100

    libstdc++: Simplify <ext/aligned_buffer.h> class templates

    As noted in a comment, the __gnu_cxx::__aligned_membuf class template
    can be simplified, because alignof(T) and alignas(T) use the correct
    alignment for a data member. That's true since GCC 8 and Clang 8. The
    EDG front end (as used by Intel icc, aka "Intel C++ Compiler Classic")
    does not implement the PR c++/69560 change, so keep using the old
    implementation when __EDG__ is defined, to avoid an ABI change for icc.

    For __gnu_cxx::__aligned_buffer<T> all supported compilers agree on the
    value of __alignof__(T), but we can still simplify it by removing the
    dependency on std::aligned_storage<sizeof(T), __alignof__(T)>.

    Add a test that checks that the aligned buffer types have the expected
    alignment, so that we can tell if changes like this affect their ABI
    properties.

    libstdc++-v3/ChangeLog:

            * include/ext/aligned_buffer.h (__aligned_membuf): Use
            alignas(T) directly instead of defining a struct and using 9its
            alignment.
            (__aligned_buffer): Remove use of std::aligned_storage.
            * testsuite/abi/aligned_buffers.cc: New test.

Reply via email to