Revert ABI changes to std::allocator in C++20
authorJonathan Wakely <jwakely@redhat.com>
Thu, 24 Oct 2019 15:29:41 +0000 (16:29 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 24 Oct 2019 15:29:41 +0000 (16:29 +0100)
commit75c6a925dab5b7af9ab47c10906cb0e140261cc2
tree7118ea8e1c16b8855187cdfe10af00f75cff4891
parentbf037872d3cd0928bea72335dc7a138a0b2fb43c
Revert ABI changes to std::allocator in C++20

The recent C++20 changes to remove the std::allocator<void> explicit
specialization and the destructor in the std::allocator primary template
change the result of some is_trivially_xxx type traits. To avoid those
changes, this patch restores the explicit specialization and the
destructor.

In order to meet the C++20 requirements the std::allocator<void>
explicit specialization must provide the same interface as the primary
template (except for the unusable allocate and deallocate member
functions) and the destructor in the primary template must be constexpr.

* include/bits/allocator.h (allocator<void>): Restore the explicit
specialization for C++20, but make its API consistent with the primary
template.
(allocator::~allocator()): Restore the destructor for C++20, but make
it constexpr.
* testsuite/20_util/allocator/rebind_c++20.cc: Check allocator<void>.
* testsuite/20_util/allocator/requirements/typedefs_c++20.cc: Likewise.
* testsuite/20_util/allocator/void.cc: Check that constructors and
destructors are trivial. Check for converting constructor in C++20.
* testsuite/ext/malloc_allocator/variadic_construct.cc: Simplify
dejagnu target selector.
* testsuite/ext/new_allocator/variadic_construct.cc: Likewise.

From-SVN: r277410
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/testsuite/20_util/allocator/rebind_c++20.cc
libstdc++-v3/testsuite/20_util/allocator/requirements/typedefs_c++20.cc
libstdc++-v3/testsuite/20_util/allocator/void.cc
libstdc++-v3/testsuite/ext/malloc_allocator/variadic_construct.cc
libstdc++-v3/testsuite/ext/new_allocator/variadic_construct.cc