summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/static-init.c
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-02-02 22:57:15 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-02-02 22:57:15 +0000
commit7cffb63a9d1d7a8d0b75b23ed2f859ede20a06a3 (patch)
tree26a32d1200139cc692ae7794046773f1b72bcbbb /clang/test/Sema/static-init.c
parente862b3dd96a033e88b9d60f2fcecfa656a0405f0 (diff)
downloadbcm5719-llvm-7cffb63a9d1d7a8d0b75b23ed2f859ede20a06a3.tar.gz
bcm5719-llvm-7cffb63a9d1d7a8d0b75b23ed2f859ede20a06a3.zip
emit diagnostic when casting a ptr to a small int when doing static initialization (addresses Eli's comments I believe)
llvm-svn: 63562
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 a4035e69df4..b3c8d0f9f18 100644
--- a/clang/test/Sema/static-init.c
+++ b/clang/test/Sema/static-init.c
@@ -16,4 +16,5 @@ struct foo {
};
union bar u[1];
-struct foo x = {(int) u}; // no-error
+struct foo x = {(long) u}; // no-error
+struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
OpenPOWER on IntegriCloud