Add include needed for MSVC.
[clang/acc.git] / test / Sema / incomplete-decl.c
blobeb93e8e380310d38cbe0a1d33676a4c7e5e6afa2
1 // RUN: clang-cc -fsyntax-only -verify %s
3 struct foo; // expected-note 4 {{forward declaration of 'struct foo'}}
5 void b; // expected-error {{variable has incomplete type 'void'}}
6 struct foo f; // expected-error{{tentative definition has type 'struct foo' that is never completed}}
8 static void c; // expected-error {{variable has incomplete type 'void'}}
9 static struct foo g; // expected-error {{variable has incomplete type 'struct foo'}}
11 extern void d;
12 extern struct foo e;
14 int ary[]; // expected-warning {{tentative array definition assumed to have one element}}
15 struct foo bary[]; // expected-error {{array has incomplete element type 'struct foo'}}
17 void func() {
18 int ary[]; // expected-error{{variable has incomplete type 'int []'}}
19 void b; // expected-error {{variable has incomplete type 'void'}}
20 struct foo f; // expected-error {{variable has incomplete type 'struct foo'}}
23 int h[]; // expected-warning {{tentative array definition assumed to have one element}}
24 int (*i)[] = &h+1; // expected-error {{arithmetic on pointer to incomplete type 'int (*)[]'}}
26 struct bar j = {1}; // expected-error {{variable has incomplete type 'struct bar'}} \
27 expected-note {{forward declaration of 'struct bar'}}
28 struct bar k;
29 struct bar { int a; };