aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-init.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-01-21 23:53:58 +0000
committerSteve Naroff <snaroff@apple.com>2008-01-21 23:53:58 +0000
commitca107309ffbcacae31d1685ab133f75ca0d7271a (patch)
tree914cd1ac086b0aa7fd226f83a9f168d77fec4614 /test/Sema/array-init.c
parent397cbf265369c914c3a58c124629bb1984104102 (diff)
Sema::CheckInitializerTypes(). Start simpliying and cleaning up...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/array-init.c')
-rw-r--r--test/Sema/array-init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index af4b04b725..60bb6afd9f 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -162,3 +162,8 @@ void charArrays()
int i3[] = {}; //expected-error{{at least one initializer value required to size array}} expected-warning{{use of GNU empty initializer extension}}
}
+void variableArrayInit() {
+ int a = 4;
+ char strlit[a] = "foo"; //expected-error{{variable-sized object may not be initialized}}
+ int b[a] = { 1, 2, 4 }; //expected-error{{variable-sized object may not be initialized}}
+}