diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-05-25 13:22:35 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-05-25 13:22:35 +0000 |
commit | 638e14413a4557c399fa2b7da2be5e4e9c1330a2 (patch) | |
tree | 710a3b8f30e8d6f50097e2818ffe7fe7ee40ab09 /test/Sema/array-init.c | |
parent | bf0c9bdd492662e637b6b8eef0ccc23d211ad883 (diff) | |
download | clang-638e14413a4557c399fa2b7da2be5e4e9c1330a2.tar.gz |
Move the error checking for variable-sized objects so we don't
double-report errors; fixes PR2362.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/array-init.c')
-rw-r--r-- | test/Sema/array-init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c index 2ddd245935..a7f27b68f8 100644 --- a/test/Sema/array-init.c +++ b/test/Sema/array-init.c @@ -208,3 +208,7 @@ struct bittest bittestvar = {1, 2, 3, 4}; //expected-warning{{excess elements in int u1 = {}; //expected-warning{{use of GNU empty initializer extension}} expected-error{{scalar initializer cannot be empty}} int u2 = {{3}}; //expected-error{{too many braces around scalar initializer}} +// PR2362 +void varArray() { + int c[][x] = { 0 }; //expected-error{{variable-sized object may not be initialized}} +} |