aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-init.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-09-12 20:13:48 +0000
committerSteve Naroff <snaroff@apple.com>2007-09-12 20:13:48 +0000
commit410e3e206b50e0336bd294fa5fb8dfcca3ee1af5 (patch)
tree206738f7853f84462b79b2e3feecb1d59650b240 /test/Sema/array-init.c
parent37f97010c1e8c81eb0d3b431bf7cd54dca89bde2 (diff)
Remove a FIXME. Replace a couple asserts with an appropriate error
diagnostic for illegal initializers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/array-init.c')
-rw-r--r--test/Sema/array-init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index 98387bedd0..5eed259dff 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -1,5 +1,7 @@
// RUN: clang -parse-ast-check -pedantic %s
+extern int foof() = 1; // expected-error{{illegal initializer (only variables can be initialized)}}
+
static int x, y, z;
static int ary[] = { x, y, z }; // expected-error{{initializer element is not constant}}
@@ -12,6 +14,8 @@ static int ary3[] = { 1, "abc", 3, 4 }; // expected-warning{{incompatible types
void func() {
int x = 1;
+ typedef int TInt = 1; // expected-error{{illegal initializer (only variables can be initialized)}}
+
int xComputeSize[] = { 1, 3, 5 };
int x3[x] = { 1, 2 }; // expected-error{{variable-sized object may not be initialized}}