Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s |
Steve Naroff | f009063 | 2007-09-02 02:04:30 +0000 | [diff] [blame] | 2 | |
Steve Naroff | 410e3e2 | 2007-09-12 20:13:48 +0000 | [diff] [blame] | 3 | extern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}} |
| 4 | |
Steve Naroff | 6f9f307 | 2007-09-02 15:34:30 +0000 | [diff] [blame] | 5 | static int x, y, z; |
| 6 | |
Chris Lattner | d880363 | 2008-08-10 01:58:45 +0000 | [diff] [blame] | 7 | static int ary[] = { x, y, z }; // expected-error{{initializer element is not a compile-time constant}} |
| 8 | int ary2[] = { x, y, z }; // expected-error{{initializer element is not a compile-time constant}} |
Steve Naroff | 6f9f307 | 2007-09-02 15:34:30 +0000 | [diff] [blame] | 9 | |
| 10 | extern int fileScopeExtern[3] = { 1, 3, 5 }; // expected-warning{{'extern' variable has an initializer}} |
| 11 | |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 12 | static long ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}} |
Steve Naroff | 38374b0 | 2007-09-02 20:30:18 +0000 | [diff] [blame] | 13 | |
Steve Naroff | f009063 | 2007-09-02 02:04:30 +0000 | [diff] [blame] | 14 | void func() { |
| 15 | int x = 1; |
| 16 | |
Steve Naroff | 410e3e2 | 2007-09-12 20:13:48 +0000 | [diff] [blame] | 17 | typedef int TInt = 1; // expected-error{{illegal initializer (only variables can be initialized)}} |
| 18 | |
Steve Naroff | d35005e | 2007-09-03 01:24:23 +0000 | [diff] [blame] | 19 | int xComputeSize[] = { 1, 3, 5 }; |
Steve Naroff | f009063 | 2007-09-02 02:04:30 +0000 | [diff] [blame] | 20 | |
Steve Naroff | 38374b0 | 2007-09-02 20:30:18 +0000 | [diff] [blame] | 21 | int x3[x] = { 1, 2 }; // expected-error{{variable-sized object may not be initialized}} |
Steve Naroff | f009063 | 2007-09-02 02:04:30 +0000 | [diff] [blame] | 22 | |
Eli Friedman | 759f252 | 2009-05-16 11:45:48 +0000 | [diff] [blame] | 23 | int x4 = { 1, 2 }; // expected-warning{{excess elements in scalar initializer}} |
Steve Naroff | f009063 | 2007-09-02 02:04:30 +0000 | [diff] [blame] | 24 | |
| 25 | int y[4][3] = { |
| 26 | { 1, 3, 5 }, |
| 27 | { 2, 4, 6 }, |
| 28 | { 3, 5, 7 }, |
| 29 | }; |
| 30 | |
| 31 | int y2[4][3] = { |
| 32 | 1, 3, 5, 2, 4, 6, 3, 5, 7 |
| 33 | }; |
| 34 | |
Steve Naroff | d35005e | 2007-09-03 01:24:23 +0000 | [diff] [blame] | 35 | int y3[4][3] = { |
| 36 | { 1, 3, 5 }, |
| 37 | { 2, 4, 6 }, |
| 38 | { 3, 5, 7 }, |
| 39 | { 4, 6, 8 }, |
Douglas Gregor | 7c53ca6 | 2009-02-18 22:23:55 +0000 | [diff] [blame] | 40 | { 5 }, // expected-warning{{excess elements in array initializer}} |
Steve Naroff | d35005e | 2007-09-03 01:24:23 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
Steve Naroff | f009063 | 2007-09-02 02:04:30 +0000 | [diff] [blame] | 43 | struct threeElements { |
| 44 | int a,b,c; |
| 45 | } z = { 1 }; |
| 46 | |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 47 | struct threeElements *p = 7; // expected-warning{{incompatible integer to pointer conversion initializing 'struct threeElements *' with an expression of type 'int'}} |
Steve Naroff | 6f9f307 | 2007-09-02 15:34:30 +0000 | [diff] [blame] | 48 | |
| 49 | extern int blockScopeExtern[3] = { 1, 3, 5 }; // expected-error{{'extern' variable cannot have an initializer}} |
Steve Naroff | 38374b0 | 2007-09-02 20:30:18 +0000 | [diff] [blame] | 50 | |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 51 | static long x2[3] = { 1.0, "abc" , 5.8 }; // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}} |
Steve Naroff | f009063 | 2007-09-02 02:04:30 +0000 | [diff] [blame] | 52 | } |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 53 | |
| 54 | void test() { |
| 55 | int y1[3] = { |
Douglas Gregor | 7c53ca6 | 2009-02-18 22:23:55 +0000 | [diff] [blame] | 56 | { 1, 2, 3 } // expected-warning{{braces around scalar initializer}} expected-warning{{excess elements in scalar initializer}} |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 57 | }; |
| 58 | int y3[4][3] = { |
| 59 | { 1, 3, 5 }, |
| 60 | { 2, 4, 6 }, |
| 61 | { 3, 5, 7 }, |
| 62 | { 4, 6, 8 }, |
Douglas Gregor | 7c53ca6 | 2009-02-18 22:23:55 +0000 | [diff] [blame] | 63 | { }, // expected-warning{{use of GNU empty initializer extension}} expected-warning{{excess elements in array initializer}} |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 64 | }; |
| 65 | int y4[4][3] = { |
Douglas Gregor | 7c53ca6 | 2009-02-18 22:23:55 +0000 | [diff] [blame] | 66 | { 1, 3, 5, 2 }, // expected-warning{{excess elements in array initializer}} |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 67 | { 4, 6 }, |
| 68 | { 3, 5, 7 }, |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 69 | { 4, 6, 8 }, |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 70 | }; |
| 71 | } |
| 72 | |
| 73 | void allLegalAndSynonymous() { |
| 74 | short q[4][3][2] = { |
| 75 | { 1 }, |
| 76 | { 2, 3 }, |
| 77 | { 4, 5, 6 } |
| 78 | }; |
| 79 | short q2[4][3][2] = { |
| 80 | { 1, 0, 0, 0, 0, 0 }, |
| 81 | { 2, 3, 0, 0, 0, 0 }, |
| 82 | { 4, 5, 6 } |
| 83 | }; |
| 84 | short q3[4][3][2] = { |
| 85 | { |
| 86 | { 1 }, |
| 87 | }, |
| 88 | { |
| 89 | { 2, 3 }, |
| 90 | }, |
| 91 | { |
| 92 | { 4, 5 }, |
| 93 | { 6 }, |
| 94 | }, |
| 95 | }; |
| 96 | } |
| 97 | |
| 98 | void legal() { |
| 99 | short q[][3][2] = { |
| 100 | { 1 }, |
| 101 | { 2, 3 }, |
| 102 | { 4, 5, 6 } |
| 103 | }; |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 104 | int q_sizecheck[(sizeof(q) / sizeof(short [3][2])) == 3? 1 : -1]; |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Steve Naroff | fd8b4a4 | 2007-10-18 03:27:23 +0000 | [diff] [blame] | 107 | unsigned char asso_values[] = { 34 }; |
| 108 | int legal2() { |
| 109 | return asso_values[0]; |
| 110 | } |
| 111 | |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 112 | void illegal() { |
| 113 | short q2[4][][2] = { // expected-error{{array has incomplete element type 'short [][2]'}} |
| 114 | { 1, 0, 0, 0, 0, 0 }, |
| 115 | { 2, 3, 0, 0, 0, 0 }, |
| 116 | { 4, 5, 6 } |
| 117 | }; |
| 118 | short q3[4][3][] = { // expected-error{{array has incomplete element type 'short []'}} |
| 119 | { |
| 120 | { 1 }, |
| 121 | }, |
| 122 | { |
| 123 | { 2, 3 }, |
| 124 | }, |
| 125 | { |
| 126 | { 4, 5 }, |
| 127 | { 6 }, |
| 128 | }, |
| 129 | }; |
Chris Lattner | fd89bc8 | 2008-04-02 01:05:10 +0000 | [diff] [blame] | 130 | int a[][] = { 1, 2 }; // expected-error{{array has incomplete element type 'int []'}} |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | typedef int AryT[]; |
| 134 | |
| 135 | void testTypedef() |
| 136 | { |
| 137 | AryT a = { 1, 2 }, b = { 3, 4, 5 }; |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 138 | int a_sizecheck[(sizeof(a) / sizeof(int)) == 2? 1 : -1]; |
| 139 | int b_sizecheck[(sizeof(b) / sizeof(int)) == 3? 1 : -1]; |
Steve Naroff | 371227d | 2007-09-04 02:20:04 +0000 | [diff] [blame] | 140 | } |
| 141 | |
Steve Naroff | 2fdc374 | 2007-12-10 22:44:33 +0000 | [diff] [blame] | 142 | static char const xx[] = "test"; |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 143 | int xx_sizecheck[(sizeof(xx) / sizeof(char)) == 5? 1 : -1]; |
Steve Naroff | 2fdc374 | 2007-12-10 22:44:33 +0000 | [diff] [blame] | 144 | static char const yy[5] = "test"; |
| 145 | static char const zz[3] = "test"; // expected-warning{{initializer-string for char array is too long}} |
| 146 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 147 | void charArrays() { |
| 148 | static char const test[] = "test"; |
| 149 | int test_sizecheck[(sizeof(test) / sizeof(char)) == 5? 1 : -1]; |
| 150 | static char const test2[] = { "weird stuff" }; |
| 151 | static char const test3[] = { "test", "excess stuff" }; // expected-warning{{excess elements in char array initializer}} |
Steve Naroff | 2fdc374 | 2007-12-10 22:44:33 +0000 | [diff] [blame] | 152 | |
| 153 | char* cp[] = { "Hello" }; |
| 154 | |
| 155 | char c[] = { "Hello" }; |
| 156 | int l[sizeof(c) == 6 ? 1 : -1]; |
| 157 | |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 158 | int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [7]'}} |
Douglas Gregor | 7c53ca6 | 2009-02-18 22:23:55 +0000 | [diff] [blame] | 159 | char c2[] = { "Hello", "Good bye" }; //expected-warning{{excess elements in char array initializer}} |
Steve Naroff | 2fdc374 | 2007-12-10 22:44:33 +0000 | [diff] [blame] | 160 | |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 161 | int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'int' with an expression of type 'char [6]'}} |
Steve Naroff | 2fdc374 | 2007-12-10 22:44:33 +0000 | [diff] [blame] | 162 | char c3[5] = { "Hello" }; |
| 163 | char c4[4] = { "Hello" }; //expected-warning{{initializer-string for char array is too long}} |
| 164 | |
Daniel Dunbar | 396f0bf | 2008-08-18 20:28:46 +0000 | [diff] [blame] | 165 | int i3[] = {}; //expected-warning{{zero size arrays are an extension}} expected-warning{{use of GNU empty initializer extension}} |
Steve Naroff | 2fdc374 | 2007-12-10 22:44:33 +0000 | [diff] [blame] | 166 | } |
| 167 | |
Steve Naroff | ca10730 | 2008-01-21 23:53:58 +0000 | [diff] [blame] | 168 | void variableArrayInit() { |
| 169 | int a = 4; |
Eli Friedman | cfdc81a | 2009-12-19 08:11:05 +0000 | [diff] [blame] | 170 | char strlit[a] = "foo"; //expected-error{{array initializer must be an initializer list or string literal}} |
Steve Naroff | ca10730 | 2008-01-21 23:53:58 +0000 | [diff] [blame] | 171 | int b[a] = { 1, 2, 4 }; //expected-error{{variable-sized object may not be initialized}} |
| 172 | } |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 173 | |
| 174 | // Pure array tests |
| 175 | float r1[10] = {{7}}; //expected-warning{{braces around scalar initializer}} |
| 176 | float r2[] = {{8}}; //expected-warning{{braces around scalar initializer}} |
| 177 | char r3[][5] = {1,2,3,4,5,6}; |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 178 | int r3_sizecheck[(sizeof(r3) / sizeof(char[5])) == 2? 1 : -1]; |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 179 | char r3_2[sizeof r3 == 10 ? 1 : -1]; |
Douglas Gregor | 7c53ca6 | 2009-02-18 22:23:55 +0000 | [diff] [blame] | 180 | float r4[1][2] = {1,{2},3,4}; //expected-warning{{braces around scalar initializer}} expected-warning{{excess elements in array initializer}} |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 181 | char r5[][5] = {"aa", "bbb", "ccccc"}; |
| 182 | char r6[sizeof r5 == 15 ? 1 : -1]; |
| 183 | const char r7[] = "zxcv"; |
| 184 | char r8[5] = "5char"; |
| 185 | char r9[5] = "6chars"; //expected-warning{{initializer-string for char array is too long}} |
| 186 | |
| 187 | int r11[0] = {}; //expected-warning{{zero size arrays are an extension}} expected-warning{{use of GNU empty initializer extension}} |
| 188 | |
| 189 | // Some struct tests |
| 190 | void autoStructTest() { |
| 191 | struct s1 {char a; char b;} t1; |
| 192 | struct s2 {struct s1 c;} t2 = { t1 }; |
| 193 | // The following is a less than great diagnostic (though it's on par with EDG). |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 194 | struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char' with an expression of type 'char [4]'}} |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 195 | int t4[sizeof t3 == 6 ? 1 : -1]; |
| 196 | } |
Steve Naroff | 578edc6 | 2008-01-28 02:00:41 +0000 | [diff] [blame] | 197 | struct foo { int z; } w; |
| 198 | int bar (void) { |
Douglas Gregor | 08a4190 | 2010-04-09 17:53:29 +0000 | [diff] [blame] | 199 | struct foo z = { w }; //expected-error{{initializing 'int' with an expression of incompatible type 'struct foo'}} |
Steve Naroff | 578edc6 | 2008-01-28 02:00:41 +0000 | [diff] [blame] | 200 | return z.z; |
| 201 | } |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 202 | struct s3 {void (*a)(void);} t5 = {autoStructTest}; |
Douglas Gregor | a645796 | 2009-03-20 00:32:56 +0000 | [diff] [blame] | 203 | struct {int a; int b[];} t6 = {1, {1, 2, 3}}; // expected-warning{{flexible array initialization is a GNU extension}} \ |
| 204 | // expected-note{{initialized flexible array member 'b' is here}} |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 205 | union {char a; int b;} t7[] = {1, 2, 3}; |
| 206 | int t8[sizeof t7 == (3*sizeof(int)) ? 1 : -1]; |
| 207 | |
| 208 | struct bittest{int : 31, a, :21, :12, b;}; |
Douglas Gregor | 7c53ca6 | 2009-02-18 22:23:55 +0000 | [diff] [blame] | 209 | struct bittest bittestvar = {1, 2, 3, 4}; //expected-warning{{excess elements in struct initializer}} |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 210 | |
| 211 | // Not completely sure what should happen here... |
Eli Friedman | c56c977 | 2008-05-19 20:29:35 +0000 | [diff] [blame] | 212 | int u1 = {}; //expected-warning{{use of GNU empty initializer extension}} expected-error{{scalar initializer cannot be empty}} |
Eli Friedman | 09865a9 | 2010-08-14 03:14:53 +0000 | [diff] [blame] | 213 | int u2 = {{3}}; //expected-warning{{too many braces around scalar initializer}} |
Steve Naroff | a996033 | 2008-01-25 00:51:06 +0000 | [diff] [blame] | 214 | |
Eli Friedman | 638e144 | 2008-05-25 13:22:35 +0000 | [diff] [blame] | 215 | // PR2362 |
| 216 | void varArray() { |
| 217 | int c[][x] = { 0 }; //expected-error{{variable-sized object may not be initialized}} |
| 218 | } |
Eli Friedman | 402256f | 2008-05-25 13:49:22 +0000 | [diff] [blame] | 219 | |
| 220 | // PR2151 |
Douglas Gregor | 0333296 | 2010-07-29 14:29:34 +0000 | [diff] [blame] | 221 | void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}} \ |
| 222 | // expected-error{{initializer for aggregate with no elements}} |
Eli Friedman | 402256f | 2008-05-25 13:49:22 +0000 | [diff] [blame] | 223 | |
Mike Stump | d1969d8 | 2009-07-22 00:43:08 +0000 | [diff] [blame] | 224 | void noNamedInit() { |
| 225 | struct {int:5;} x[] = {6}; //expected-error{{initializer for aggregate with no elements}} |
Eli Friedman | f84eda3 | 2008-05-25 14:03:31 +0000 | [diff] [blame] | 226 | } |
| 227 | struct {int a; int:5;} noNamedImplicit[] = {1,2,3}; |
| 228 | int noNamedImplicitCheck[sizeof(noNamedImplicit) == 3 * sizeof(*noNamedImplicit) ? 1 : -1]; |
| 229 | |
Nuno Lopes | 62b6a65 | 2008-09-01 22:28:55 +0000 | [diff] [blame] | 230 | |
| 231 | // ptrs are constant |
| 232 | struct soft_segment_descriptor { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 233 | long ssd_base; |
Nuno Lopes | 62b6a65 | 2008-09-01 22:28:55 +0000 | [diff] [blame] | 234 | }; |
| 235 | static int dblfault_tss; |
| 236 | |
| 237 | union uniao { int ola; } xpto[1]; |
| 238 | |
| 239 | struct soft_segment_descriptor gdt_segs[] = { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 240 | {(long) &dblfault_tss}, |
| 241 | { (long)xpto}, |
Nuno Lopes | 62b6a65 | 2008-09-01 22:28:55 +0000 | [diff] [blame] | 242 | }; |
| 243 | |
Nuno Lopes | 73419bf | 2008-09-01 18:42:41 +0000 | [diff] [blame] | 244 | static void sppp_ipv6cp_up(); |
Douglas Gregor | 0333296 | 2010-07-29 14:29:34 +0000 | [diff] [blame] | 245 | const struct {} ipcp = { sppp_ipv6cp_up }; //expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}} \ |
| 246 | // expected-warning{{excess elements in struct initializer}} |
Douglas Gregor | 4c67834 | 2009-01-28 21:54:33 +0000 | [diff] [blame] | 247 | |
| 248 | struct _Matrix { union { float m[4][4]; }; }; //expected-warning{{anonymous unions are a GNU extension in C}} |
| 249 | typedef struct _Matrix Matrix; |
| 250 | void test_matrix() { |
| 251 | const Matrix mat1 = { |
| 252 | { { 1.0f, 2.0f, 3.0f, 4.0f, |
| 253 | 5.0f, 6.0f, 7.0f, 8.0f, |
| 254 | 9.0f, 10.0f, 11.0f, 12.0f, |
| 255 | 13.0f, 14.0f, 15.0f, 16.0f } } |
| 256 | }; |
| 257 | |
| 258 | const Matrix mat2 = { |
| 259 | 1.0f, 2.0f, 3.0f, 4.0f, |
| 260 | 5.0f, 6.0f, 7.0f, 8.0f, |
| 261 | 9.0f, 10.0f, 11.0f, 12.0f, |
| 262 | 13.0f, 14.0f, 15.0f, 16.0f |
| 263 | }; |
| 264 | } |
Eli Friedman | e540858 | 2009-05-29 20:20:05 +0000 | [diff] [blame] | 265 | |
| 266 | char badchararray[1] = { badchararray[0], "asdf" }; // expected-warning {{excess elements in array initializer}} expected-error {{initializer element is not a compile-time constant}} |
Douglas Gregor | cd9ec3b | 2011-02-22 18:29:51 +0000 | [diff] [blame] | 267 | |
| 268 | // Test the GNU extension for initializing an array from an array |
| 269 | // compound literal. PR9261. |
| 270 | typedef int int5[5]; |
| 271 | int a1[5] = (int[]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int [5]' from a compound literal of type 'int [5]' is a GNU extension}} |
| 272 | int a2[5] = (int[5]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int [5]' from a compound literal of type 'int [5]' is a GNU extension}} |
| 273 | int a3[] = ((int[]){1, 2, 3, 4, 5}); // expected-warning{{initialization of an array of type 'int []' from a compound literal of type 'int [5]' is a GNU extension}} |
| 274 | int a4[] = (int[5]){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int []' from a compound literal of type 'int [5]' is a GNU extension}} |
| 275 | int a5[] = (int5){1, 2, 3, 4, 5}; // expected-warning{{initialization of an array of type 'int []' from a compound literal of type 'int5' (aka 'int [5]') is a GNU extension}} |
| 276 | |
| 277 | int a6[5] = (int[]){1, 2, 3}; // expected-error{{cannot initialize array of type 'int [5]' with array of type 'int [3]'}} |
| 278 | |
| 279 | int nonconst_value(); |
| 280 | int a7[5] = (int[5]){ 1, 2, 3, 4, nonconst_value() }; // expected-error{{initializer element is not a compile-time constant}} |