[cfe-commits] r126134 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/SemaObjC/auto-objective-c.m
Fariborz Jahanian
fjahanian at apple.com
Mon Feb 21 16:58:53 PST 2011
On Feb 21, 2011, at 4:50 PM, 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.
Thanks, I will take care of this.
- Fariborz
>
> - Doug
>
More information about the cfe-commits
mailing list