[PATCH] Fix inline versioned namespace bootstrap

Jonathan Wakely jwakely@redhat.com
Sat Aug 28 10:49:57 GMT 2021


On Sat, 28 Aug 2021 at 10:26, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Fri, 27 Aug 2021 at 22:17, Jonathan Wakely <jwakely@redhat.com> wrote:
> >
> > On Fri, 27 Aug 2021 at 21:58, François Dumont via Libstdc++
> > <libstdc++@gcc.gnu.org> wrote:
> > >
> > > Since std::allocator<void> is not specialized anymore in
> > > _GLIBCXX_INLINE_VERSION mode _ExtPtr_allocator<void> specialization do
> > > not compile
> > >
> > > because std::allocator<void> is incomplete.
> >
> > That doesn't look right ... it should be complete. This suggests there
> > is a deeper problem, which I'll look into.
>
> This is the correct fix:
>
> --- a/libstdc++-v3/include/bits/memoryfwd.h
> +++ b/libstdc++-v3/include/bits/memoryfwd.h
> @@ -63,8 +63,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>   template<typename>
>     class allocator;
>
> +#if ! _GLIBCXX_INLINE_VERSION
>   template<>
>     class allocator<void>;
> +#endif
>
> #if __cplusplus >= 201103L
>   /// Declare uses_allocator so it can be specialized in `<queue>` etc.


Actually, the allocator<void> specialization is still needed for
pre-C++20 with the versioned namespace, and that means there's the
same trivial default ctor ABI concern for the versioned namespace. I'm
testing a fix now, but it might not be committed until I'm back at
work on Tuesday.



More information about the Gcc-patches mailing list