[cfe-commits] [PATCH] Accept trailing-return-type in abstract-declarators again

Richard Smith richard at metafoo.co.uk
Mon Feb 21 16:46:34 PST 2011


On Tue, February 22, 2011 00:23, Douglas Gregor wrote:
> On Feb 21, 2011, at 4:19 PM, Richard Smith wrote:
>> The attached patch fixes a few auto-related issues:
>>
>>
>> * 'auto' was being rejected on abstract-declarators with trailing
>> return types and on typedefs with trailing return types. 'auto' is
>> always allowed in these cases. This was found while testing the fix for
>> PR 9278.
>>
>>
>> * A very poor diagnostic was being issued for auto (f() -> int):
>> "return
>> type must be 'auto', not 'auto'". This is closely related to PR 9060.
>>
>> * Trailing return type handling was happening slightly too late,
>> resulting in the checks for functions returning arrays and functions
>> returning functions being missed.
>
>
> Why is this part of the test going away?
>
>
> -typedef auto Fun(int a) -> decltype(a + a);

It just moved from p5 to p2, since that's what it's testing. But as a test
for PR 9278, it makes sense to have it in p5 too, so I've put it back.

> Otherwise, patch seems fine.

Great, r126166.

Thanks,
Richard





More information about the cfe-commits mailing list