Steve Naroff | d3cd1e5 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
Douglas Gregor | 275a369 | 2009-03-10 23:43:53 +0000 | [diff] [blame^] | 3 | struct foo; // expected-note 4 {{forward declaration of 'struct foo'}} |
Douglas Gregor | 4ec339f | 2009-01-19 19:26:10 +0000 | [diff] [blame] | 4 | |
Steve Naroff | d3cd1e5 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 5 | void b; // expected-error {{variable has incomplete type 'void'}} |
Douglas Gregor | 275a369 | 2009-03-10 23:43:53 +0000 | [diff] [blame^] | 6 | struct foo f; // expected-error{{tentative definition has type 'struct foo' that is never completed}} |
Steve Naroff | d3cd1e5 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 7 | |
| 8 | static void c; // expected-error {{variable has incomplete type 'void'}} |
| 9 | static struct foo g; // expected-error {{variable has incomplete type 'struct foo'}} |
| 10 | |
| 11 | extern void d; |
| 12 | extern struct foo e; |
| 13 | |
Steve Naroff | 9a75f8a | 2008-01-18 20:40:52 +0000 | [diff] [blame] | 14 | int ary[]; |
| 15 | struct foo bary[]; // expected-error {{array has incomplete element type 'struct foo'}} |
| 16 | |
Steve Naroff | d3cd1e5 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 17 | void func() { |
Steve Naroff | 9a75f8a | 2008-01-18 20:40:52 +0000 | [diff] [blame] | 18 | int ary[]; // expected-error{{variable has incomplete type 'int []'}} |
Steve Naroff | d3cd1e5 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 19 | void b; // expected-error {{variable has incomplete type 'void'}} |
| 20 | struct foo f; // expected-error {{variable has incomplete type 'struct foo'}} |
| 21 | } |
Chris Lattner | e60cff1 | 2008-07-03 03:53:40 +0000 | [diff] [blame] | 22 | |
| 23 | int h[]; |
| 24 | int (*i)[] = &h+1; // expected-error {{arithmetic on pointer to incomplete type 'int (*)[]'}} |
| 25 | |