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