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:36:23 +0100
> I'm not seeing what the problem is. The existing text disallows the
second `auto`.
> [dcl.spec.auto.general]/4 contains the "declares a function" restriction.
> Consequently there is no case in [dcl.spec.auto.general] that allows the
> second `auto` and it is therefore ill-formed by [dcl.spec.auto.general]/8.

I agree with you p4 is not problematic.

I see problematic p3 that allows the second auto, whereas p4 does not state
it is ill-formed.

p4 adds legal options, it does not 'erase' any option from p3,
whereas p3 formally allows that second 'auto' for the example
auto (*p)() -> auto;

p3 states legal some options in case of trailing-return-type is present,
whereas p4 adds other legal options regardless of the presence
of the trailing-return-type.

Thank you for the answer, I hope you may also provide answers
on the other 2 side points of the original post
https://lists.isocpp.org/std-discussion/2024/11/2710.php.

Received on 2024-11-20 22:36:37