array-init.c revision a99603333fffb57cf9ac37eabb190c8f5afc914b
13b427b3ba518f7a7293458c2d3d92eebd8458d87Chris Lattner// RUN: clang -fsyntax-only -verify -pedantic %s 2f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 3410e3e206b50e0336bd294fa5fb8dfcca3ee1af5Steve Naroffextern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}} 4410e3e206b50e0336bd294fa5fb8dfcca3ee1af5Steve Naroff 56f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroffstatic int x, y, z; 66f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroff 76f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroffstatic int ary[] = { x, y, z }; // expected-error{{initializer element is not constant}} 86f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroffint ary2[] = { x, y, z }; // expected-error{{initializer element is not constant}} 96f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroff 106f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroffextern int fileScopeExtern[3] = { 1, 3, 5 }; // expected-warning{{'extern' variable has an initializer}} 116f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroff 12b7b61159325e002998ff950fdc70a6425a6b13b3Chris Lattnerstatic int ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible pointer to integer conversion initializing 'char *', expected 'int'}} 1338374b05791ee93300b9fbe8ceb3957f54184b37Steve Naroff 14f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroffvoid func() { 15f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff int x = 1; 16f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 17410e3e206b50e0336bd294fa5fb8dfcca3ee1af5Steve Naroff typedef int TInt = 1; // expected-error{{illegal initializer (only variables can be initialized)}} 18410e3e206b50e0336bd294fa5fb8dfcca3ee1af5Steve Naroff 19d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff int xComputeSize[] = { 1, 3, 5 }; 20f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 2138374b05791ee93300b9fbe8ceb3957f54184b37Steve Naroff int x3[x] = { 1, 2 }; // expected-error{{variable-sized object may not be initialized}} 22f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 23371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff int x4 = { 1, 2 }; // expected-warning{{braces around scalar initializer}} expected-warning{{excess elements in array initializer}} 24f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 25f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff int y[4][3] = { 26f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff { 1, 3, 5 }, 27f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff { 2, 4, 6 }, 28f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff { 3, 5, 7 }, 29f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff }; 30f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 31f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff int y2[4][3] = { 32f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 1, 3, 5, 2, 4, 6, 3, 5, 7 33f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff }; 34f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 35d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff int y3[4][3] = { 36d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff { 1, 3, 5 }, 37d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff { 2, 4, 6 }, 38d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff { 3, 5, 7 }, 39d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff { 4, 6, 8 }, 40d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff { 5 }, // expected-warning{{excess elements in array initializer}} 41d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff }; 42d35005ece906cca5238d75b031b8db7eac0ac6e1Steve Naroff 43f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff struct threeElements { 44f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff int a,b,c; 45f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff } z = { 1 }; 46f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff 47b7b61159325e002998ff950fdc70a6425a6b13b3Chris Lattner struct threeElements *p = 7; // expected-warning{{incompatible integer to pointer conversion initializing 'int', expected 'struct threeElements *'}} 486f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroff 496f9f307d527e3451470dd07ae932475f26c6de6eSteve Naroff extern int blockScopeExtern[3] = { 1, 3, 5 }; // expected-error{{'extern' variable cannot have an initializer}} 5038374b05791ee93300b9fbe8ceb3957f54184b37Steve Naroff 51b7b61159325e002998ff950fdc70a6425a6b13b3Chris Lattner static int x2[3] = { 1.0, "abc" , 5.8 }; // expected-warning{{incompatible pointer to integer conversion initializing 'char *', expected 'int'}} 52f009063ab7e05be7781751ff9e4b42630f07a747Steve Naroff} 53371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff 54371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroffvoid test() { 55371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff int y1[3] = { 56371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1, 2, 3 } // expected-warning{{braces around scalar initializer}} expected-warning{{excess elements in array initializer}} 57371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 58371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff int y3[4][3] = { 59371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1, 3, 5 }, 60371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 2, 4, 6 }, 61371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 3, 5, 7 }, 62371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 6, 8 }, 63371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { }, // expected-warning{{use of GNU empty initializer extension}} expected-warning{{excess elements in array initializer}} 64371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 65371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff int y4[4][3] = { 66371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1, 3, 5, 2 }, // expected-warning{{excess elements in array initializer}} 67371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 6 }, 68371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 3, 5, 7 }, 69a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff { 4, 6, 8 }, 70371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 71371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff} 72371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff 73371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroffvoid allLegalAndSynonymous() { 74371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff short q[4][3][2] = { 75371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1 }, 76371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 2, 3 }, 77371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 5, 6 } 78371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 79371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff short q2[4][3][2] = { 80371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1, 0, 0, 0, 0, 0 }, 81371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 2, 3, 0, 0, 0, 0 }, 82371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 5, 6 } 83371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 84371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff short q3[4][3][2] = { 85371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 86371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1 }, 87371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }, 88371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 89371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 2, 3 }, 90371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }, 91371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 92371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 5 }, 93371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 6 }, 94371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }, 95371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 96371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff} 97371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff 98371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroffvoid legal() { 99371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff short q[][3][2] = { 100371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1 }, 101371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 2, 3 }, 102371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 5, 6 } 103371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 104371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff} 105371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff 106fd8b4a4b29a2b9d662d0c9a92c1eebd83160b10bSteve Naroffunsigned char asso_values[] = { 34 }; 107fd8b4a4b29a2b9d662d0c9a92c1eebd83160b10bSteve Naroffint legal2() { 108fd8b4a4b29a2b9d662d0c9a92c1eebd83160b10bSteve Naroff return asso_values[0]; 109fd8b4a4b29a2b9d662d0c9a92c1eebd83160b10bSteve Naroff} 110fd8b4a4b29a2b9d662d0c9a92c1eebd83160b10bSteve Naroff 111371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroffvoid illegal() { 112371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff short q2[4][][2] = { // expected-error{{array has incomplete element type 'short [][2]'}} 113371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1, 0, 0, 0, 0, 0 }, 114371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 2, 3, 0, 0, 0, 0 }, 115371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 5, 6 } 116371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 117371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff short q3[4][3][] = { // expected-error{{array has incomplete element type 'short []'}} 118371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 119371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 1 }, 120371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }, 121371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 122371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 2, 3 }, 123371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }, 124371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 125371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 4, 5 }, 126371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff { 6 }, 127371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }, 128371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff }; 129371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff // FIXME: the following two errors are redundant 130371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff int a[][] = { 1, 2 }; // expected-error{{array has incomplete element type 'int []'}} expected-error{{variable has incomplete type 'int []'}} 131371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff} 132371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff 133371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Narofftypedef int AryT[]; 134371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff 135371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroffvoid testTypedef() 136371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff{ 137371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff AryT a = { 1, 2 }, b = { 3, 4, 5 }; 138371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff} 139371227d6dc3cf89a3165d592cd9a4cbb400ec45cSteve Naroff 1402fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroffstatic char const xx[] = "test"; 1412fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroffstatic char const yy[5] = "test"; 1422fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroffstatic char const zz[3] = "test"; // expected-warning{{initializer-string for char array is too long}} 1432fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff 1442fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroffvoid charArrays() 1452fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff{ 1462fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff static char const test[] = "test"; 1472fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff static char const test2[] = { "weird stuff" }; 1482fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff static char const test3[] = { "test", "excess stuff" }; // expected-error{{excess elements in char array initializer}} 1492fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff 1502fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff char* cp[] = { "Hello" }; 1512fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff 1522fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff char c[] = { "Hello" }; 1532fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff int l[sizeof(c) == 6 ? 1 : -1]; 1542fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff 155a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff int i[] = { "Hello "}; // expected-warning{{incompatible pointer to integer conversion initializing 'char *', expected 'int'}} 1562fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff char c2[] = { "Hello", "Good bye" }; //expected-error{{excess elements in char array initializer}} 1572fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff 158a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff int i2[1] = { "Hello" }; //expected-warning{{incompatible pointer to integer conversion initializing 'char *', expected 'int'}} 1592fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff char c3[5] = { "Hello" }; 1602fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff char c4[4] = { "Hello" }; //expected-warning{{initializer-string for char array is too long}} 1612fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff 162a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff int i3[] = {}; //expected-error{{at least one initializer value required to size array}} expected-error{{variable has incomplete type 'int []'}} expected-warning{{use of GNU empty initializer extension}} 1632fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff} 1642fdc3749097a581567dbd9fe66c48c0458bd3e34Steve Naroff 165ca107309ffbcacae31d1685ab133f75ca0d7271aSteve Naroffvoid variableArrayInit() { 166ca107309ffbcacae31d1685ab133f75ca0d7271aSteve Naroff int a = 4; 167ca107309ffbcacae31d1685ab133f75ca0d7271aSteve Naroff char strlit[a] = "foo"; //expected-error{{variable-sized object may not be initialized}} 168ca107309ffbcacae31d1685ab133f75ca0d7271aSteve Naroff int b[a] = { 1, 2, 4 }; //expected-error{{variable-sized object may not be initialized}} 169ca107309ffbcacae31d1685ab133f75ca0d7271aSteve Naroff} 170a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff 171a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff// Pure array tests 172a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Narofffloat r1[10] = {{7}}; //expected-warning{{braces around scalar initializer}} 173a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Narofffloat r2[] = {{8}}; //expected-warning{{braces around scalar initializer}} 174a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffchar r3[][5] = {1,2,3,4,5,6}; 175a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffchar r3_2[sizeof r3 == 10 ? 1 : -1]; 176a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Narofffloat r4[1][2] = {1,{2},3,4}; //expected-warning{{braces around scalar initializer}} expected-warning{{excess elements in array initializer}} 177a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffchar r5[][5] = {"aa", "bbb", "ccccc"}; 178a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffchar r6[sizeof r5 == 15 ? 1 : -1]; 179a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffconst char r7[] = "zxcv"; 180a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffchar r8[5] = "5char"; 181a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffchar r9[5] = "6chars"; //expected-warning{{initializer-string for char array is too long}} 182a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff 183a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffint r11[0] = {}; //expected-warning{{zero size arrays are an extension}} expected-warning{{use of GNU empty initializer extension}} 184a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff 185a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff// Some struct tests 186a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffvoid autoStructTest() { 187a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffstruct s1 {char a; char b;} t1; 188a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffstruct s2 {struct s1 c;} t2 = { t1 }; 189a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff// The following is a less than great diagnostic (though it's on par with EDG). 190a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffstruct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char *', expected 'char'}} 191a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffint t4[sizeof t3 == 6 ? 1 : -1]; 192a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff} 193a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffstruct s3 {void (*a)(void);} t5 = {autoStructTest}; 194a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff// GCC extension; flexible array init. Once this is implemented, the warning should be removed. 195a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff// Note that clang objc implementation depends on this extension. 196a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffstruct {int a; int b[];} t6 = {1, {1, 2, 3}}; //expected-warning{{excess elements in array initializer}} 197a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffunion {char a; int b;} t7[] = {1, 2, 3}; 198a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffint t8[sizeof t7 == (3*sizeof(int)) ? 1 : -1]; 199a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff 200a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffstruct bittest{int : 31, a, :21, :12, b;}; 201a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffstruct bittest bittestvar = {1, 2, 3, 4}; //expected-warning{{excess elements in array initializer}} 202a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff 203a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff// Not completely sure what should happen here... 204a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffint u1 = {}; //expected-warning{{use of GNU empty initializer extension}} expected-warning{{braces around scalar initializer}} 205a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroffint u2 = {{3}}; //expected-warning{{braces around scalar initializer}} 206a99603333fffb57cf9ac37eabb190c8f5afc914bSteve Naroff 207