aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-init.c
diff options
context:
space:
mode:
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}}
+}