C++ Logo

std-discussion

Advanced search

Re: placeholder type in trailing return type

From: mauro russo <ing.russomauro_at_[hidden]>
Date: Wed, 20 Nov 2024 23:08:19 +0100
>> I see this lack in both the text of draft n4849 and the current draft
text.
>> e.g.
>> auto (*p)() -> auto; // ill-formed (as all major compilers act)

> For this example we have to check whether both `auto`s are legal.

> The first one is legal under p3. The second one is not legal: it appears
in the *type-specifier-seq* of the trailing return type, but the declarator
in this case doesn't declare a function. So, the entire declaration is
ill-formed.

Dear Brian, thanks for the answer.

Please, note that my example "auto (*p)() -> auto;" was exactly discussed
as the illegal case due to the second 'auto'.
My discussion was exactly focused on the fact that the overall text of
[decl.spec.auto.general] seems not excluding this case.

It seems you haven't really read my 3 points, just focused on the example.
Please, be patient and check again details of my discussion.

That detail is not even present in [dcl.fct]-p(1.3) that just forces to
have return type auto in decl-specifiers in case there is
trailing-return-type,
and I really believe that detail shuld be precise in
[decl.spec.auto.general].

Thanks,
Mauro.

>

Received on 2024-11-20 22:08:31