Re: [PATCH] c++: CTAD within alias template [PR91911]

2022-01-19 Thread Jason Merrill via Gcc-patches
ds in place because the tf_partial workaround is necessary to accept class-deduction93a.C below, and the tsubst workaround is necessary to accept class-deduction-92b.C below. Whoops, forgot to git-add class-deduction93a.C: -- >8 -- Subject: [PATCH] c++: CTAD within alias template [PR91911] In t

Re: [PATCH] c++: CTAD within alias template [PR91911]

2022-01-19 Thread Patrick Palka via Gcc-patches
t; really be 2). > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > For the other way around, if ConstSpanType is a > > > > > > > > > >

Re: [PATCH] c++: CTAD within alias template [PR91911]

2022-01-19 Thread Jason Merrill via Gcc-patches
tsubst workaround is necessary to accept class-deduction-92b.C below. Whoops, forgot to git-add class-deduction93a.C: -- >8 -- Subject: [PATCH] c++: CTAD within alias template [PR91911] In the first testcase below, during parsing of the alias template ConstSpanType, transparency of alias tem

Re: [PATCH] c++: CTAD within alias template [PR91911]

2022-01-19 Thread Patrick Palka via Gcc-patches
d, if ConstSpanType is a member > > > > > > > > > > > template of > > > > > > > > > > > say the class template B (and thus its level is greater > > > > > > > > > > > than > > > > > > &g

Re: [PATCH] c++: CTAD within alias template [PR91911]

2022-01-06 Thread Patrick Palka via Gcc-patches
panType is a member > > > > > > > > > > > template of > > > > > > > > > > > say the class template B (and thus its level is greater > > > > > > > > > > > than > > > > > > > > > >

Re: [PATCH] c++: CTAD within alias template [PR91911]

2022-01-03 Thread Patrick Palka via Gcc-patches
gt; > > > > > > > > > > > > > > template > > > > > > > > > > using SpanType = decltype(span(T())); > > > > > > > > > > > > > > > > > > > > template >

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-12-21 Thread Jason Merrill via Gcc-patches
sense. Here's a patch that implements that. I reckon it's good to have both workarounds in place because the tf_partial workaround is necessary to accept class-deduction93a.C below, and the tsubst workaround is necessary to accept class-deduction-92b.C below. Whoops, forgot to git-add class-

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-12-21 Thread Patrick Palka via Gcc-patches
template > > >>>>>> struct B { > > >>>>>>template > > >>>>>>using ConstSpanType = span > >>>>>> SpanType::value_type>; > > >>>>>> }; > > >>&g

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-12-21 Thread Patrick Palka via Gcc-patches
pe = B::ConstSpanType; > >>>>>> > >>>>>> then tf_partial doesn't help here at all; we end up substituting 'int' > >>>>>> for the CTAD placeholder... What it seems we need is to _increase_ the > >>>>>>

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-30 Thread Jason Merrill via Gcc-patches
93a.C below, and the tsubst workaround is necessary to accept class-deduction-92b.C below. Whoops, forgot to git-add class-deduction93a.C: -- >8 -- Subject: [PATCH] c++: CTAD within alias template [PR91911] In the first testcase below, during parsing of the alias template ConstSpanTy

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-30 Thread Patrick Palka via Gcc-patches
>>>> substitution.. > >>>> > >>>> Hmm, rather than messing with tf_partial, which is apparently only a > >>>> partial solution, maybe we should just make tsubst never substitute a > >>>> CTAD placeholder -- they should always b

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-30 Thread Jason Merrill via Gcc-patches
Makes sense. Here's a patch that implements that. I reckon it's good to have both workarounds in place because the tf_partial workaround is necessary to accept class-deduction93a.C below, and the tsubst workaround is necessary to accept class-deduction-92b.C below. Whoops, forgot to

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-30 Thread Patrick Palka via Gcc-patches
t.c > > > index 5107bfbf9d1..dead651ed84 100644 > > > --- a/gcc/cp/pt.c > > > +++ b/gcc/cp/pt.c > > > @@ -15552,7 +15550,8 @@ tsubst (tree t, tree args, tsubst_flags_t > > > complain, > > > tree in_decl) > > > levels

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-30 Thread Patrick Palka via Gcc-patches
.c b/gcc/cp/pt.c > > index 5107bfbf9d1..dead651ed84 100644 > > --- a/gcc/cp/pt.c > > +++ b/gcc/cp/pt.c > > @@ -15552,7 +15550,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, > > tree in_decl) > > levels = TMPL_ARGS_DEPTH (args); > > i

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-25 Thread Jason Merrill via Gcc-patches
On 6/25/21 1:11 PM, Patrick Palka wrote: On Fri, 25 Jun 2021, Jason Merrill wrote: On 6/24/21 4:45 PM, Patrick Palka wrote: In the first testcase below, during parsing of the alias template ConstSpanType, transparency of alias template specializations means we replace SpanType with SpanType's

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-25 Thread Patrick Palka via Gcc-patches
On Fri, 25 Jun 2021, Jason Merrill wrote: > On 6/24/21 4:45 PM, Patrick Palka wrote: > > In the first testcase below, during parsing of the alias template > > ConstSpanType, transparency of alias template specializations means we > > replace SpanType with SpanType's substituted definition. But th

Re: [PATCH] c++: CTAD within alias template [PR91911]

2021-06-25 Thread Jason Merrill via Gcc-patches
On 6/24/21 4:45 PM, Patrick Palka wrote: In the first testcase below, during parsing of the alias template ConstSpanType, transparency of alias template specializations means we replace SpanType with SpanType's substituted definition. But this substitution lowers the level of the CTAD placeholde

[PATCH] c++: CTAD within alias template [PR91911]

2021-06-24 Thread Patrick Palka via Gcc-patches
In the first testcase below, during parsing of the alias template ConstSpanType, transparency of alias template specializations means we replace SpanType with SpanType's substituted definition. But this substitution lowers the level of the CTAD placeholder for span(T()) from 2 to 1, and so the lat