1// RUN: %clang_cc1 -fsyntax-only -verify %s 2 3struct foo; // expected-note 5 {{forward declaration of 'struct foo'}} 4 5void b; // expected-error {{variable has incomplete type 'void'}} 6struct foo f; // expected-error{{tentative definition has type 'struct foo' that is never completed}} 7 8static void c; // expected-error {{variable has incomplete type 'void'}} 9static struct foo g; // expected-warning {{tentative definition of variable with internal linkage has incomplete non-array type 'struct foo'}} \ 10 expected-error{{tentative definition has type 'struct foo' that is never completed}} 11 12extern void d; 13extern struct foo e; 14 15int ary[]; // expected-warning {{tentative array definition assumed to have one element}} 16struct foo bary[]; // expected-error {{array has incomplete element type 'struct foo'}} 17 18void func() { 19 int ary[]; // expected-error{{definition of variable with array type needs an explicit size or an initializer}} 20 void b; // expected-error {{variable has incomplete type 'void'}} 21 struct foo f; // expected-error {{variable has incomplete type 'struct foo'}} 22} 23 24int h[]; // expected-warning {{tentative array definition assumed to have one element}} 25int (*i)[] = &h+1; // expected-error {{arithmetic on a pointer to an incomplete type 'int []'}} 26 27struct bar j = {1}; // expected-error {{variable has incomplete type 'struct bar'}} \ 28 expected-note {{forward declaration of 'struct bar'}} 29struct bar k; 30struct bar { int a; }; 31 32