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

Hans Wennborg hans at chromium.org
Tue Aug 14 11:59:28 PDT 2012


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? And should it give an
error for this:

  void f(int (^x[static 10])());

Thanks,
Hans



More information about the cfe-commits mailing list