aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-04-13 13:03:44 +0100
committerJonathan Wakely <jwakely@redhat.com>2024-06-03 21:17:54 +0100
commitb0efdcbf58a76af3b8fff75f1d53d334fb5b46ee (patch)
tree8042b194384b3101d4f1a2bb8167a8140aedf111 /gcc
parent0426be454448f8cfb9db21f4f669426afb7b57c8 (diff)
downloadgcc-b0efdcbf58a76af3b8fff75f1d53d334fb5b46ee.zip
gcc-b0efdcbf58a76af3b8fff75f1d53d334fb5b46ee.tar.gz
gcc-b0efdcbf58a76af3b8fff75f1d53d334fb5b46ee.tar.bz2
libstdc++: Handle extended alignment in std::get_temporary_buffer [PR105258]
This adds extended alignment support to std::get_temporary_buffer etc. so that when std::stable_sort uses a temporary buffer it works for overaligned types. Also simplify the _Temporary_buffer type by using RAII for the allocation, via a new data member. This simplifies the _Temporary_buffer constructor and destructor by makingthem only responsible for constructing and destroying the elements, not managing the memory. libstdc++-v3/ChangeLog: PR libstdc++/105258 * include/bits/stl_tempbuf.h (__detail::__get_temporary_buffer): New function to do allocation for get_temporary_buffer, with extended alignment support. (__detail::__return_temporary_buffer): Support extended alignment. (get_temporary_buffer): Use __get_temporary_buffer. (return_temporary_buffer): Support extended alignment. Add deprecated attribute. (_Temporary_buffer): Move allocation and deallocation into a subobject and remove try-catch block in constructor. (__uninitialized_construct_buf): Use argument deduction for value type. * testsuite/20_util/temporary_buffer.cc: Add dg-warning for new deprecated warning. * testsuite/25_algorithms/stable_sort/overaligned.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions