summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/static-init.c
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-02-02 16:07:41 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-02-02 16:07:41 +0000
commit598afdcfe758846b5e248a5e9b457a3c1f2d9901 (patch)
treea39576a167ebb3f4c3d156b600c4c858da6080fb /clang/test/Sema/static-init.c
parent0c92d25f2b23bc4119fe1f1382567d4f3b6355b4 (diff)
downloadbcm5719-llvm-598afdcfe758846b5e248a5e9b457a3c1f2d9901.tar.gz
bcm5719-llvm-598afdcfe758846b5e248a5e9b457a3c1f2d9901.zip
allow cast from array to int to be considered as constant
llvm-svn: 63519
Diffstat (limited to 'clang/test/Sema/static-init.c')
-rw-r--r--clang/test/Sema/static-init.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/Sema/static-init.c b/clang/test/Sema/static-init.c
index 2f1380062d3..a4035e69df4 100644
--- a/clang/test/Sema/static-init.c
+++ b/clang/test/Sema/static-init.c
@@ -2,6 +2,18 @@
static int f = 10;
static int b = f; // expected-error {{initializer element is not a compile-time constant}}
-float r = (float) &r; // expected-error {{initializer element is not a compile-time constant}}
+float r = (float) &r; // FIXME: should give an error: ptr value used where a float was expected
long long s = (long long) &s;
_Bool t = &t;
+
+
+union bar {
+ int i;
+};
+
+struct foo {
+ unsigned ptr;
+};
+
+union bar u[1];
+struct foo x = {(int) u}; // no-error
OpenPOWER on IntegriCloud