fc6f1128ae
When I added the std::allocator_traits<std::allocator<void>> specialization it broke code like this: std::allocate_shared<const int>(std::allocator<void>()); The problem is that allocator_traits<allocator<void>>::construct(a, p) now uses std::_Construct(p), which only does a static_cast<void*>(p) and so fails if the pointer has cv-quals. This changes std::_Construct (and the related std::_Construct_novalue) to use a C-style cast to (void*) which matches the effects of the "voidify" helper in the C++20 standard. libstdc++-v3/ChangeLog: * include/bits/stl_construct.h (_Construct, _Construct_novalue): Also cast away cv-qualifiers when converting pointer to void. * testsuite/20_util/allocator/void.cc: Test construct function with cv-qualified types. |
||
---|---|---|
.. | ||
requirements | ||
1.cc | ||
8230.cc | ||
10378.cc | ||
14176.cc | ||
33807.cc | ||
64135.cc | ||
89510.cc | ||
lwg3190.cc | ||
overaligned.cc | ||
rebind_c++20.cc | ||
void.cc |