Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Eli Friedman | e919e38 | 2009-12-10 08:54:47 +0000 | [diff] [blame] | 2 | // PR5515 |
| 3 | |
| 4 | extern int a[]; |
| 5 | int a[10]; |
| 6 | extern int b[10]; |
| 7 | int b[]; |
| 8 | extern int c[1]; |
| 9 | int c[] = {1,2}; // expected-error {{excess elements in array initializer}} |
Richard Smith | cd3d5d9 | 2012-07-07 23:00:31 +0000 | [diff] [blame] | 10 | |
| 11 | int d[1][]; // expected-error {{array has incomplete element type 'int []'}} |
Eli Friedman | 07bab73 | 2012-12-13 01:43:21 +0000 | [diff] [blame] | 12 | |
David Majnemer | 38a50c0 | 2015-07-14 20:08:49 +0000 | [diff] [blame] | 13 | extern const int e[2]; // expected-note {{previous declaration is here}} |
Eli Friedman | 07bab73 | 2012-12-13 01:43:21 +0000 | [diff] [blame] | 14 | int e[] = { 1 }; // expected-error {{redefinition of 'e' with a different type: 'int []' vs 'const int [2]'}} |