[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 16:44:41 PST 2011


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.

Richard





More information about the cfe-commits mailing list