Steve Naroff | b7b032e | 2008-01-30 00:44:01 +0000 | [diff] [blame] | 1 | // RUN: clang %s -verify -fsyntax-only |
| 2 | |
| 3 | const int a [1] = {1}; |
| 4 | extern const int a[]; |
| 5 | |
| 6 | extern const int b[]; |
| 7 | const int b [1] = {1}; |
| 8 | |
| 9 | extern const int c[] = {1}; // expected-warning{{'extern' variable has an initializer}} |
| 10 | const int c[]; |
| 11 | |
| 12 | int i1 = 1; // expected-error{{previous definition is here}} |
| 13 | int i1 = 2; // expected-error{{redefinition of 'i1'}} // expected-error{{previous definition is here}} |
| 14 | // FIXME: the following should not be an error (see related FIXME in Sema::MergeVarDecl). |
| 15 | int i1; // expected-error{{redefinition of 'i1'}} |
| 16 | int i1; |
| 17 | extern int i1; // expected-error{{previous definition is here}} |
| 18 | static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} expected-error{{previous definition is here}} |
| 19 | int i1 = 3; // expected-error{{non-static declaration of 'i1' follows static declaration}} |
| 20 | |
| 21 | void func() { |
| 22 | extern int i1; // expected-error{{previous definition is here}} |
| 23 | static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} |
| 24 | } |