gcc/libstdc++-v3/testsuite/20_util/allocator
Jonathan Wakely fc6f1128ae libstdc++: Ignore cv-quals when std::allocator<void> constructs
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.
2022-01-14 10:14:25 +00:00
..
requirements Update copyright years. 2022-01-03 10:42:10 +01:00
1.cc Update copyright years. 2022-01-03 10:42:10 +01:00
8230.cc Update copyright years. 2022-01-03 10:42:10 +01:00
10378.cc Update copyright years. 2022-01-03 10:42:10 +01:00
14176.cc Update copyright years. 2022-01-03 10:42:10 +01:00
33807.cc Update copyright years. 2022-01-03 10:42:10 +01:00
64135.cc
89510.cc Update copyright years. 2022-01-03 10:42:10 +01:00
lwg3190.cc Update copyright years. 2022-01-03 10:42:10 +01:00
overaligned.cc Update copyright years. 2022-01-03 10:42:10 +01:00
rebind_c++20.cc Update copyright years. 2022-01-03 10:42:10 +01:00
void.cc libstdc++: Ignore cv-quals when std::allocator<void> constructs 2022-01-14 10:14:25 +00:00