diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-29 19:42:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-29 19:42:23 +0000 |
commit | bf7207a11f336ee575ea7661fa973db9ce34cc20 (patch) | |
tree | 40214ac18e00c5ff6eca552041729306caa26c86 /clang/test/Sema/designated-initializers.c | |
parent | 56b3b77c7d347d32075d46805145ad5806dff7df (diff) | |
download | bcm5719-llvm-bf7207a11f336ee575ea7661fa973db9ce34cc20.tar.gz bcm5719-llvm-bf7207a11f336ee575ea7661fa973db9ce34cc20.zip |
Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension
llvm-svn: 63327
Diffstat (limited to 'clang/test/Sema/designated-initializers.c')
-rw-r--r-- | clang/test/Sema/designated-initializers.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/test/Sema/designated-initializers.c b/clang/test/Sema/designated-initializers.c index efd0d406511..53da306c4c3 100644 --- a/clang/test/Sema/designated-initializers.c +++ b/clang/test/Sema/designated-initializers.c @@ -18,8 +18,7 @@ int iarray2[10] = { }; int iarray3[10] = { - [5 ... 12] = 2 // expected-error{{array designator index (12) exceeds array bounds (10)}}\ - // expected-warning{{side effects due to the GNU array-range designator extension may occur multiple times}} + [5 ... 12] = 2 // expected-error{{array designator index (12) exceeds array bounds (10)}} }; struct point { @@ -45,8 +44,8 @@ struct point array[10] = { struct point array2[10] = { [10].x = 2.0, // expected-error{{array designator index (10) exceeds array bounds (10)}} - [4 ... 5].y = 2.0, // expected-warning{{side effects due to the GNU array-range designator extension may occur multiple times}} - [4 ... 6] = { .x = 3, .y = 4.0 } // expected-warning{{side effects due to the GNU array-range designator extension may occur multiple times}} + [4 ... 5].y = 2.0, + [4 ... 6] = { .x = 3, .y = 4.0 } }; struct point array3[10] = { @@ -117,7 +116,7 @@ struct disklabel_ops disklabel64_ops = { // PR clang/3378 int bitwidth[] = { [(long long int)1] = 5, [(short int)2] = 2 }; int a[]= { [sizeof(int)] = 0 }; -int a2[]= { [0 ... sizeof(int)] = 0 }; // expected-warning{{side effects due to the GNU array-range designator extension may occur multiple times}} +int a2[]= { [0 ... sizeof(int)] = 0 }; // Test warnings about initializers overriding previous initializers struct X { |