754fca77e8
Removing the allocator<void> specialization for the versioned namespace breaks _Extptr_allocator<void> because the allocator<void> specialization was still declared in <bits/memoryfwd.h>, making it an incomplete type. It wrong to remove that specialization anyway, because it is still needed pre-C++20. This removes the #if ! _GLIBCXX_INLINE_VERSION check, so that allocator<void> is still explicitly specialized for the versioned namespace, consistent with the normal unversioned namespace mode. To make _Extptr_allocator<void> usable as a ProtoAllocator, this change adds a default constructor and converting constructor. That is consistent with std::allocator<void> since C++20 (and harmless to do for earlier standards). I'm also explicitly specializing allocator_traits<allocator<void>> so that it doesn't need to use allocator<void>::construct and destroy. Doing that allows those members to be removed, further simplifying allocator<void>. That new explicit specialization can delete the allocate, deallocate and max_size members, which are always ill-formed for allocator<void>. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h (allocator_traits): Add explicit specialization for allocator<void>. Improve doxygen comments. * include/bits/allocator.h (allocator<void>): Restore for the versioned namespace. (allocator<void>::construct, allocator<void>::destroy): Remove. * include/ext/extptr_allocator.h (_Extptr_allocator<void>): Add default constructor and converting constructor. |
||
---|---|---|
.. | ||
pb_ds | ||
algorithm | ||
aligned_buffer.h | ||
alloc_traits.h | ||
atomicity.h | ||
bitmap_allocator.h | ||
cast.h | ||
cmath | ||
codecvt_specializations.h | ||
concurrence.h | ||
debug_allocator.h | ||
enc_filebuf.h | ||
extptr_allocator.h | ||
functional | ||
iterator | ||
malloc_allocator.h | ||
memory | ||
mt_allocator.h | ||
new_allocator.h | ||
numeric | ||
numeric_traits.h | ||
pod_char_traits.h | ||
pointer.h | ||
pool_allocator.h | ||
random | ||
random.tcc | ||
rb_tree | ||
rc_string_base.h | ||
rope | ||
ropeimpl.h | ||
slist | ||
sso_string_base.h | ||
stdio_filebuf.h | ||
stdio_sync_filebuf.h | ||
string_conversions.h | ||
throw_allocator.h | ||
type_traits.h | ||
typelist.h | ||
vstring_fwd.h | ||
vstring_util.h | ||
vstring.h | ||
vstring.tcc |