blob: bd603681d64184ba1355322f86a0e761f97f47d6 [file] [log] [blame]
Steve Narofffef2f052008-01-18 00:39:39 +00001// RUN: clang -fsyntax-only -verify %s
2
Douglas Gregor46fe06e2009-01-19 19:26:10 +00003struct foo; // expected-note {{forward declaration of 'struct foo'}}
4
Steve Narofffef2f052008-01-18 00:39:39 +00005void b; // expected-error {{variable has incomplete type 'void'}}
6struct foo f; // expected-error {{variable has incomplete type 'struct foo'}}
7
8static void c; // expected-error {{variable has incomplete type 'void'}}
9static struct foo g; // expected-error {{variable has incomplete type 'struct foo'}}
10
11extern void d;
12extern struct foo e;
13
Steve Naroff60685462008-01-18 20:40:52 +000014int ary[];
15struct foo bary[]; // expected-error {{array has incomplete element type 'struct foo'}}
16
Steve Narofffef2f052008-01-18 00:39:39 +000017void func() {
Steve Naroff60685462008-01-18 20:40:52 +000018 int ary[]; // expected-error{{variable has incomplete type 'int []'}}
Steve Narofffef2f052008-01-18 00:39:39 +000019 void b; // expected-error {{variable has incomplete type 'void'}}
20 struct foo f; // expected-error {{variable has incomplete type 'struct foo'}}
21}
Chris Lattnerd5b92242008-07-03 03:53:40 +000022
23int h[];
24int (*i)[] = &h+1; // expected-error {{arithmetic on pointer to incomplete type 'int (*)[]'}}
25