Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-14 Thread Ville Voutilainen
On Thu, 13 Mar 2025 at 23:03, Patrick Palka wrote: > + // Defined as a template to work around PR libstdc++/116440. > + template > + constexpr explicit(!__convertible()) > + tuple(const _Elements&... __elements) I don't understand how a constructor template declared like thi

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Patrick Palka
On Thu, 13 Mar 2025, Jonathan Wakely wrote: > On Thu, 13 Mar 2025 at 21:29, Patrick Palka wrote: > > > > On Thu, 13 Mar 2025, Ville Voutilainen wrote: > > > > > On Thu, 13 Mar 2025 at 23:16, Ville Voutilainen > > > wrote: > > > > > > > > On Thu, 13 Mar 2025 at 23:03, Patrick Palka wrote: > > >

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Ville Voutilainen
On Fri, 14 Mar 2025 at 00:04, Ville Voutilainen wrote: > > On Fri, 14 Mar 2025 at 00:03, Ville Voutilainen > wrote: > > > > On Thu, 13 Mar 2025 at 23:57, Jonathan Wakely wrote: > > > > Do we also want to constraint the tuple(const _Elements&...) > > > > constructor with requires sizeof...(_Eleme

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Ville Voutilainen
On Thu, 13 Mar 2025 at 23:28, Patrick Palka wrote: > > Oh, never mind. The pack is just deduced as an empty pack. > > Yep that's my understanding, though I don't know where in the standard > this is specified, a quick Ctrl+F is failing me. I'll go with https://eel.is/c++draft/temp.variadic#9, and

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025 at 21:54, Jonathan Wakely wrote: > > On Thu, 13 Mar 2025 at 21:29, Patrick Palka wrote: > > > > On Thu, 13 Mar 2025, Ville Voutilainen wrote: > > > > > On Thu, 13 Mar 2025 at 23:16, Ville Voutilainen > > > wrote: > > > > > > > > On Thu, 13 Mar 2025 at 23:03, Patrick Palka wr

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025, 22:28 Patrick Palka, wrote: > On Thu, 13 Mar 2025, Jonathan Wakely wrote: > > > On Thu, 13 Mar 2025 at 21:29, Patrick Palka wrote: > > > > > > On Thu, 13 Mar 2025, Ville Voutilainen wrote: > > > > > > > On Thu, 13 Mar 2025 at 23:16, Ville Voutilainen > > > > wrote: > > > >

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Ville Voutilainen
On Fri, 14 Mar 2025 at 00:03, Ville Voutilainen wrote: > > On Thu, 13 Mar 2025 at 23:57, Jonathan Wakely wrote: > > > Do we also want to constraint the tuple(const _Elements&...) > > > constructor with requires sizeof...(_Elements) >= 1, which is present > > > on the C++17 version? > > > > Oh we

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Ville Voutilainen
On Thu, 13 Mar 2025 at 23:57, Jonathan Wakely wrote: > > Do we also want to constraint the tuple(const _Elements&...) > > constructor with requires sizeof...(_Elements) >= 1, which is present > > on the C++17 version? > > Oh we don't need that constraint, because we have an explicit > specializati

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Jonathan Wakely
On Thu, 13 Mar 2025 at 21:29, Patrick Palka wrote: > > On Thu, 13 Mar 2025, Ville Voutilainen wrote: > > > On Thu, 13 Mar 2025 at 23:16, Ville Voutilainen > > wrote: > > > > > > On Thu, 13 Mar 2025 at 23:03, Patrick Palka wrote: > > > > + // Defined as a template to work around PR libstdc++

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Patrick Palka
On Thu, 13 Mar 2025, Ville Voutilainen wrote: > On Thu, 13 Mar 2025 at 23:16, Ville Voutilainen > wrote: > > > > On Thu, 13 Mar 2025 at 23:03, Patrick Palka wrote: > > > + // Defined as a template to work around PR libstdc++/116440. > > > + template > > > + constexpr explicit(!__

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Ville Voutilainen
On Thu, 13 Mar 2025 at 23:14, Patrick Palka wrote: > Ah, I just realized the C++17 tuple impl already defines the > tuple(const _Elements&...) constructor as a template in order to > constrain it! So this patch arguably makes the C++20 constructor > set more consistent with the C++17 impl, and so

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Ville Voutilainen
On Thu, 13 Mar 2025 at 23:16, Ville Voutilainen wrote: > > On Thu, 13 Mar 2025 at 23:03, Patrick Palka wrote: > > + // Defined as a template to work around PR libstdc++/116440. > > + template > > + constexpr explicit(!__convertible()) > > + tuple(const _Elements&... __elemen

Re: [PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Patrick Palka
On Thu, 13 Mar 2025, Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk, and 14 after > a while? > > -- >8 -- > > The type tuple> is clearly copy/move constructible, but for > reasons that are not yet completely understood checking this triggers > constraint recurs

[PATCH] libstdc++: Work around C++20 tuple> constraint recursion [PR116440]

2025-03-13 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk, and 14 after a while? -- >8 -- The type tuple> is clearly copy/move constructible, but for reasons that are not yet completely understood checking this triggers constraint recursion with our C++20 tuple implementation (and not the C++17