summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/uninit-variables.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-08-08 21:43:08 +0000
committerTed Kremenek <kremenek@apple.com>2011-08-08 21:43:08 +0000
commita0cdf58b0c348bb0515db384855dd2c9d59a492d (patch)
tree46c12b1a40e52035f8e42148f51e830c241284a0 /clang/test/SemaCXX/uninit-variables.cpp
parentc96953c12aeead73ff37a7d346b101bdec3ffc25 (diff)
downloadbcm5719-llvm-a0cdf58b0c348bb0515db384855dd2c9d59a492d.tar.gz
bcm5719-llvm-a0cdf58b0c348bb0515db384855dd2c9d59a492d.zip
Fix another -Wuninitialized assertion failure (this one involving bit casts) resulting from the recent -Wuninitialized changes.
llvm-svn: 137068
Diffstat (limited to 'clang/test/SemaCXX/uninit-variables.cpp')
-rw-r--r--clang/test/SemaCXX/uninit-variables.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/uninit-variables.cpp b/clang/test/SemaCXX/uninit-variables.cpp
index 6c5d0068a43..9abccf07510 100644
--- a/clang/test/SemaCXX/uninit-variables.cpp
+++ b/clang/test/SemaCXX/uninit-variables.cpp
@@ -130,3 +130,14 @@ void test_noop_cast2() {
int y = (int&)x; // expected-warning {{uninitialized when used here}}
}
+// Test handling of bit casts.
+void test_bitcasts() {
+ int x = 1;
+ int y = (float &)x; // no-warning
+}
+
+void test_bitcasts_2() {
+ int x; // expected-note {{declared here}} expected-note {{add initialization}}
+ int y = (float &)x; // expected-warning {{uninitialized when used here}}
+}
+
OpenPOWER on IntegriCloud