[cfe-commits] [Patch] Produce errors for 'static' and type qualifiers in array declarators

Eli Friedman eli.friedman at gmail.com
Tue Aug 14 12:15:42 PDT 2012


On Tue, Aug 14, 2012 at 11:59 AM, Hans Wennborg <hans at chromium.org> wrote:
> On Tue, Aug 14, 2012 at 6:28 PM, John McCall <rjmccall at apple.com> wrote:
>> Looks great, thanks!  Might as well add a test for the function and block-pointer
>> cases (to verify that an error is emitted, but not this one), but feel free to commit.
>
> Now that I start playing with it, I don't seem to get any errors for
> the block-pointer case. I'm not very familiar with these things, but I
> think that this:
>
>   void f(int (^x[10])());
>
> declares a function f that takes a parameter x, which is an array of
> block pointers that return int. Clang doesn't give an error here
> (assuming I use -fblocks of course). Should it?

I don't think so; what kind of error are you expecting?

> And should it give an
> error for this:
>
>   void f(int (^x[static 10])());

I don't think so.

-Eli



More information about the cfe-commits mailing list