[cfe-commits] r126134 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/SemaObjC/auto-objective-c.m

Richard Smith richard at metafoo.co.uk
Mon Feb 21 17:09:44 PST 2011


On Tue, February 22, 2011 00:50, Douglas Gregor wrote:
> On Feb 21, 2011, at 4:44 PM, Richard Smith wrote:
>> On Mon, February 21, 2011 18:37, Fariborz Jahanian wrote:
>>> Author: fjahanian
>>> Date: Mon Feb 21 12:37:13 2011
>>> New Revision: 126134
>>>
>>>
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=126134&view=rev
>>> Log:
>>> Turn on 'auto' in plain  objc mode.
>>>
>>
>> Without trailing return type support, this produces unhelpful
>> diagnostics:
>>
>>
>> $ echo -e 'auto a();' | clang++ -xobjective-c -
>> <stdin>:1:1: error: 'auto' return without trailing return type
>> auto a(); ^
>> 1 error generated.
>> $ echo -e 'auto a() -> void;' | clang++ -xobjective-c -
>> <stdin>:1:10: error: expected function body after function declarator
>> auto a() -> void; ^
>> 1 error generated.
>>
>>
>> It should be straightforward to teach GetTypeForDeclarator that
>> objective-c (or perhaps anything that's not C++) is a special case, if
>> you don't want trailing return types there too.
>
> Good point! We don't want trailing return types in Objective-C.

This should sort it out.

Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-auto-objc-trt.diff
Type: text/x-patch
Size: 2974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110222/a7391404/attachment.bin>


More information about the cfe-commits mailing list