blob: de957403a3a82f7d1008e919d31b03825e6c9f1d [file] [log] [blame]
Steve Naroffd3cd1e52008-01-18 00:39:39 +00001// RUN: clang -fsyntax-only -verify %s
2
Douglas Gregor275a3692009-03-10 23:43:53 +00003struct foo; // expected-note 4 {{forward declaration of 'struct foo'}}
Douglas Gregor4ec339f2009-01-19 19:26:10 +00004
Steve Naroffd3cd1e52008-01-18 00:39:39 +00005void b; // expected-error {{variable has incomplete type 'void'}}
Douglas Gregor275a3692009-03-10 23:43:53 +00006struct foo f; // expected-error{{tentative definition has type 'struct foo' that is never completed}}
Steve Naroffd3cd1e52008-01-18 00:39:39 +00007
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 Naroff9a75f8a2008-01-18 20:40:52 +000014int ary[];
15struct foo bary[]; // expected-error {{array has incomplete element type 'struct foo'}}
16
Steve Naroffd3cd1e52008-01-18 00:39:39 +000017void func() {
Steve Naroff9a75f8a2008-01-18 20:40:52 +000018 int ary[]; // expected-error{{variable has incomplete type 'int []'}}
Steve Naroffd3cd1e52008-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 Lattnere60cff12008-07-03 03:53:40 +000022
23int h[];
24int (*i)[] = &h+1; // expected-error {{arithmetic on pointer to incomplete type 'int (*)[]'}}
25