As mentioned in a recent cfe-dev thread [1], Clang currently fails to
produce errors for using 'static' and type qualifiers in array
declarators outside of function prototypes. For example:

void f(int x[static 42]) { // <-- This is fine.
  int a[static 42]; // <-- This should be an error.
}

Attached is my attempt to fix this.

One thing I was uncertain of is what to do when the code has multiple
errors. For example, if it has 'static' in an array declarator that is
both outside a function prototype, and also not in the first pair of
brackets. Currently, my patch only gives one error.

Please take a look.

Thanks,
Hans

[1]. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-August/023482.html

Attachment: static_in_array_decls.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to