summaryrefslogtreecommitdiffstats
path: root/clang/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
commit437b4d8bda0181cbec71441088dab2b490593de4 (patch)
tree88a94039c3a72460239504879cc58a147bf0f6a4 /clang/test/Sema/array-init.c
parentfe1da5ec56b6f2271cf00a6ed0b340f029ff8041 (diff)
downloadbcm5719-llvm-437b4d8bda0181cbec71441088dab2b490593de4.tar.gz
bcm5719-llvm-437b4d8bda0181cbec71441088dab2b490593de4.zip
Remove a FIXME. Replace a couple asserts with an appropriate error
diagnostic for illegal initializers. llvm-svn: 41889
Diffstat (limited to 'clang/test/Sema/array-init.c')
-rw-r--r--clang/test/Sema/array-init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Sema/array-init.c b/clang/test/Sema/array-init.c
index 98387bedd01..5eed259dff5 100644
--- a/clang/test/Sema/array-init.c
+++ b/clang/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}}
OpenPOWER on IntegriCloud