This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR72792 PR72793 relax requirements on rebind members


I misread the specifications for pointer_traits::rebind and
allocator_traits::rebind_alloc and was requiring them to be valid for
any specialization of the class templates. In fact they're only needed
if instantiated. This fixes the problem.

	PR libstdc++/72792
	PR libstdc++/72793
	* include/bits/alloc_traits.h (__allocator_traits_base::__rebind):
	Replace with class template using void_t.
	(__alloc_rebind): Define in terms of
	__allocator_traits_base::__rebind.
	(allocator_traits): Remove unconditional static_assert for
	rebind_alloc.
	* include/bits/ptr_traits.h (__replace_first_arg): Remove type member.
	(pointer_traits::__rebind): Replace with class template using void_t.
	(pointer_traits::rebind): Define in terms of __rebind.
	(pointer_traits): Remove unconditional static_assert for rebind.
	* testsuite/20_util/allocator_traits/members/rebind_alloc.cc: New test.
	* testsuite/20_util/pointer_traits/rebind.cc: New test.

Tested powerpc64le-linux, committed to trunk.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]