From 410e3e206b50e0336bd294fa5fb8dfcca3ee1af5 Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Wed, 12 Sep 2007 20:13:48 +0000 Subject: 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 --- test/Sema/array-init.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/Sema/array-init.c') 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}} -- cgit v1.2.3-70-g09d2