* [PATCH] Fix inline versioned namespace bootstrap
@ 2021-08-27 20:57 François Dumont
2021-08-27 21:17 ` Jonathan Wakely
0 siblings, 1 reply; 6+ messages in thread
From: François Dumont @ 2021-08-27 20:57 UTC (permalink / raw)
To: libstdc++; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 320 bytes --]
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.
So I think primary _ExtPtr_allocator template should also be prefered in
_GLIBCXX_INLINE_VERSION mode.
Ok to commit ?
François
[-- Attachment #2: extptr_allocator.h.patch --]
[-- Type: text/x-patch, Size: 645 bytes --]
diff --git a/libstdc++-v3/include/ext/extptr_allocator.h b/libstdc++-v3/include/ext/extptr_allocator.h
index 7d8aaac7cee..78ee1fa039f 100644
--- a/libstdc++-v3/include/ext/extptr_allocator.h
+++ b/libstdc++-v3/include/ext/extptr_allocator.h
@@ -162,6 +162,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
std::allocator<_Tp> _M_real_alloc;
};
+#if ! _GLIBCXX_INLINE_VERSION
// _ExtPtr_allocator<void> specialization.
template<>
class _ExtPtr_allocator<void>
@@ -183,6 +184,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
private:
std::allocator<void> _M_real_alloc;
};
+#endif
template<typename _Tp>
inline void
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix inline versioned namespace bootstrap
2021-08-27 20:57 [PATCH] Fix inline versioned namespace bootstrap François Dumont
@ 2021-08-27 21:17 ` Jonathan Wakely
2021-08-28 9:26 ` Jonathan Wakely
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2021-08-27 21:17 UTC (permalink / raw)
To: François Dumont; +Cc: libstdc++, gcc-patches
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.
>
> So I think primary _ExtPtr_allocator template should also be prefered in
> _GLIBCXX_INLINE_VERSION mode.
I think it should always be preferred. The _ExtPtr_allocator<void>
specialization is useless, it is missing the converting constructor
that would be needed to convert to/from that type to any other
_ExtPtr_allocator<T> specialization.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix inline versioned namespace bootstrap
2021-08-27 21:17 ` Jonathan Wakely
@ 2021-08-28 9:26 ` Jonathan Wakely
2021-08-28 10:49 ` Jonathan Wakely
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2021-08-28 9:26 UTC (permalink / raw)
To: François Dumont; +Cc: libstdc++, gcc-patches
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.
>
>
> >
> > So I think primary _ExtPtr_allocator template should also be prefered in
> > _GLIBCXX_INLINE_VERSION mode.
>
> I think it should always be preferred. The _ExtPtr_allocator<void>
> specialization is useless, it is missing the converting constructor
> that would be needed to convert to/from that type to any other
> _ExtPtr_allocator<T> specialization.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix inline versioned namespace bootstrap
2021-08-28 9:26 ` Jonathan Wakely
@ 2021-08-28 10:49 ` Jonathan Wakely
2021-08-28 12:40 ` François Dumont
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2021-08-28 10:49 UTC (permalink / raw)
To: François Dumont; +Cc: libstdc++, gcc-patches
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix inline versioned namespace bootstrap
2021-08-28 10:49 ` Jonathan Wakely
@ 2021-08-28 12:40 ` François Dumont
2021-08-28 13:38 ` Jonathan Wakely
0 siblings, 1 reply; 6+ messages in thread
From: François Dumont @ 2021-08-28 12:40 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: libstdc++
On 28/08/21 12:49 pm, Jonathan Wakely wrote:
> 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.
>
Ok, there's no rush.
Note that I noticed that because I am working on PR 83077 to allow sso
string in versioned namespace.
My plan is to make the sso string the only std::string implementation in
versioned namespace.
Now that I saw your RFC about dropping C++98 support for versioned
namespace I think my approach fall into this. But I also think that this
RFC will be approved so it should be fine unless you have another concern.
François
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix inline versioned namespace bootstrap
2021-08-28 12:40 ` François Dumont
@ 2021-08-28 13:38 ` Jonathan Wakely
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Wakely @ 2021-08-28 13:38 UTC (permalink / raw)
To: François Dumont; +Cc: libstdc++
On Sat, 28 Aug 2021 at 13:40, François Dumont <frs.dumont@gmail.com> wrote:
>
> On 28/08/21 12:49 pm, Jonathan Wakely wrote:
> > 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.
> >
> Ok, there's no rush.
I've pushed the fix now.
>
> Note that I noticed that because I am working on PR 83077 to allow sso
> string in versioned namespace.
>
> My plan is to make the sso string the only std::string implementation in
> versioned namespace.
Great, thanks.
>
> Now that I saw your RFC about dropping C++98 support for versioned
> namespace I think my approach fall into this. But I also think that this
> RFC will be approved so it should be fine unless you have another concern.
>
> François
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-08-28 13:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 20:57 [PATCH] Fix inline versioned namespace bootstrap François Dumont
2021-08-27 21:17 ` Jonathan Wakely
2021-08-28 9:26 ` Jonathan Wakely
2021-08-28 10:49 ` Jonathan Wakely
2021-08-28 12:40 ` François Dumont
2021-08-28 13:38 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).