Steve Naroff | fef2f05 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
Douglas Gregor | 46fe06e | 2009-01-19 19:26:10 +0000 | [diff] [blame] | 3 | struct foo; // expected-note {{forward declaration of 'struct foo'}} |
| 4 | |
Steve Naroff | fef2f05 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 5 | void b; // expected-error {{variable has incomplete type 'void'}} |
| 6 | struct foo f; // expected-error {{variable has incomplete type 'struct foo'}} |
| 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 | 6068546 | 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 | fef2f05 | 2008-01-18 00:39:39 +0000 | [diff] [blame] | 17 | void func() { |
Steve Naroff | 6068546 | 2008-01-18 20:40:52 +0000 | [diff] [blame] | 18 | int ary[]; // expected-error{{variable has incomplete type 'int []'}} |
Steve Naroff | fef2f05 | 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 | d5b9224 | 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 | |