blob: 2a26103a317e4e5d49b9ac990140bcd1062aafd2 [file] [log] [blame]
Steve Narofff0090632007-09-02 02:04:30 +00001// RUN: clang -parse-ast-check -pedantic %s
2
3void func() {
4 int x = 1;
5
6 //int x2[] = { 1, 3, 5 };
7
8 int x3[x] = { 1, 2 }; // gcc-error {{variable-sized object may not be initialized}}
9
10 int x4 = { 1, 2 }; // gcc-warning {{excess elements in array initializer}}
11
12 int y[4][3] = {
13 { 1, 3, 5 },
14 { 2, 4, 6 },
15 { 3, 5, 7 },
16 };
17
18 int y2[4][3] = {
19 1, 3, 5, 2, 4, 6, 3, 5, 7
20 };
21
22 struct threeElements {
23 int a,b,c;
24 } z = { 1 };
25
26 struct threeElements *p = 7; // expected-warning{{incompatible types assigning 'int' to 'struct threeElements *'}}
27}