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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/Sema/static-init.c b/clang/test/Sema/static-init.c
index b4de92713b8..ec6d1e8fc0d 100644
--- a/clang/test/Sema/static-init.c
+++ b/clang/test/Sema/static-init.c
@@ -19,5 +19,6 @@ struct foo {
};
union bar u[1];
-struct foo x = {(intptr_t) u}; // no-error
+struct foo x = {(intptr_t) u}; // expected-error {{initializer element is not a compile-time constant}}
struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
+intptr_t z = (intptr_t) u; // no-error
OpenPOWER on IntegriCloud