blob: b1095bdc1941adaa5610473757a17a661fb818bf [file] [log] [blame]
Steve Naroff209689a2007-08-26 14:38:38 +00001// RUN: clang -parse-ast-check -pedantic %s
Chris Lattner4b009652007-07-25 00:24:17 +00002
3struct s;
4struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}}
Chris Lattnerd4c473b2007-08-26 06:48:28 +00005 return z;
Chris Lattner4b009652007-07-25 00:24:17 +00006}
7
8void *k (void l[2]) { // expected-error {{array has incomplete element type}}
9 return l;
10}
11
Steve Naroff209689a2007-08-26 14:38:38 +000012struct vari {
13 int a;
14 int b[];
15};
16
17struct vari *func(struct vari a[]) { // expected-error {{'struct vari' may not be used as an array element due to flexible array member}}
18 return a;
19}
20
21int foo[](void); // expected-error {{'foo' declared as array of functions}}
22
23typedef int (*pfunc)(void);
24
25pfunc xx(int f[](void)) { // expected-error {{'f' declared as array of functions}}
26 return f;
27}