Date: Thu, 21 Nov 2024 00:28:52 +0100
On Thu, Nov 21, 2024 at 12:08 AM mauro russo <ing.russomauro_at_[hidden]>
wrote:
>
> > No, p3 doesn't allow the second `auto`. I'm not sure how you can read it
> that way.
> > Each of p2-p7 defines a *context* in which placeholders are legal;
> > it doesn't define the legality of the entire construct in which the
> placeholder appears.
> > The context that is made legal by p3 is the one occupied by the first
> `auto`, namely the decl-specifier-seq,
> > so it says nothing about the legality of the second `auto`.
> > It only means that, if there's no trailing return type present at all,
> > then p3 doesn't give any permission for a placeholder to appear in the
> decl-specifier-seq.
>
> I see your point, ok. I was likely biased by the old text of C++20
> (reported in the original post 2710)
> but it is useless to discuss it now, as it cannot change.
> Thank you.
>
>
> > As to your second point, I'm not sure which p1 you're referring to.
> > The text you quote, "or as one of the type-specifiers in a
> trailing-return-type",
> > does not appear in [dcl.spec.auto.general]/1
> <https://eel.is/c++draft/dcl.spec.auto.general#1>.
>
> About second point, my bad, I meant p2, sorry for having written p1.
>
This paragraph only discusses uses of placeholders that are used to declare
the type of a parameter or template parameter. The text "The placeholder
type shall appear as [...] or [...]" applies only in those contexts.
The conversion function case is covered by [dcl.spec.auto.general]/4. You
can't have a trailing return type for a conversion function, so
"type-specifier-seq" in this paragraph refers to the *type-specifier-seq*
in *conversion-type-id* ([class.conv.fct]). Notice that [class.conv.fct]/2
says that "its declared return type is the *conversion-type-id*", which
links it to [dcl.spec.auto.general]/4 where we also talk about "declared
return type".
CWG2476 <https://cplusplus.github.io/CWG/issues/2476.html> was very
extensively reviewed in CWG.
>
>
> > As to your third point, are you suggesting that in that one comment we
> > should use the hyphenated spelling?
> > Or do you want to change other comments to say "trailing return type"?
>
> About third point, it might just be fixed adding dashes;
> trailing-return-type,
> for the sake of uniformity with all other points in the standard.
> I guess it worth doing it only together any other needed change, not alone.
>
>
> Hope not to abuse your patience, I would have another point around this
> standard clauses,
> that I was first checking on the web, for which I also posted on
> stackoverflow today
> (
> https://stackoverflow.com/questions/79208177/multiple-occurrences-of-placeholder-type-auto-in-a-type
> )
> without getting any concrete answer. It is related about the plural words
> "the occurrences" in [dcl.type.auto.deduct]-p3.
> You can read there my question.
>
>>
I don't know the answer to this one.
wrote:
>
> > No, p3 doesn't allow the second `auto`. I'm not sure how you can read it
> that way.
> > Each of p2-p7 defines a *context* in which placeholders are legal;
> > it doesn't define the legality of the entire construct in which the
> placeholder appears.
> > The context that is made legal by p3 is the one occupied by the first
> `auto`, namely the decl-specifier-seq,
> > so it says nothing about the legality of the second `auto`.
> > It only means that, if there's no trailing return type present at all,
> > then p3 doesn't give any permission for a placeholder to appear in the
> decl-specifier-seq.
>
> I see your point, ok. I was likely biased by the old text of C++20
> (reported in the original post 2710)
> but it is useless to discuss it now, as it cannot change.
> Thank you.
>
>
> > As to your second point, I'm not sure which p1 you're referring to.
> > The text you quote, "or as one of the type-specifiers in a
> trailing-return-type",
> > does not appear in [dcl.spec.auto.general]/1
> <https://eel.is/c++draft/dcl.spec.auto.general#1>.
>
> About second point, my bad, I meant p2, sorry for having written p1.
>
This paragraph only discusses uses of placeholders that are used to declare
the type of a parameter or template parameter. The text "The placeholder
type shall appear as [...] or [...]" applies only in those contexts.
The conversion function case is covered by [dcl.spec.auto.general]/4. You
can't have a trailing return type for a conversion function, so
"type-specifier-seq" in this paragraph refers to the *type-specifier-seq*
in *conversion-type-id* ([class.conv.fct]). Notice that [class.conv.fct]/2
says that "its declared return type is the *conversion-type-id*", which
links it to [dcl.spec.auto.general]/4 where we also talk about "declared
return type".
CWG2476 <https://cplusplus.github.io/CWG/issues/2476.html> was very
extensively reviewed in CWG.
>
>
> > As to your third point, are you suggesting that in that one comment we
> > should use the hyphenated spelling?
> > Or do you want to change other comments to say "trailing return type"?
>
> About third point, it might just be fixed adding dashes;
> trailing-return-type,
> for the sake of uniformity with all other points in the standard.
> I guess it worth doing it only together any other needed change, not alone.
>
>
> Hope not to abuse your patience, I would have another point around this
> standard clauses,
> that I was first checking on the web, for which I also posted on
> stackoverflow today
> (
> https://stackoverflow.com/questions/79208177/multiple-occurrences-of-placeholder-type-auto-in-a-type
> )
> without getting any concrete answer. It is related about the plural words
> "the occurrences" in [dcl.type.auto.deduct]-p3.
> You can read there my question.
>
>>
I don't know the answer to this one.
-- *Brian Bi*
Received on 2024-11-20 23:29:08