summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/static-init.c
diff options
context:
space:
mode:
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