aboutsummaryrefslogtreecommitdiff
path: root/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
commitde091aeb4658e986ed8fa5fbce7ab35ef2ae26ec (patch)
treeca64e962caff5c5b2c77e26c1785323fc4e505d7 /test/SemaCXX/uninit-variables.cpp
parent5d8c062b8c1e5d42ecfa3c6ad52cf71c966516f0 (diff)
Fix another -Wuninitialized assertion failure (this one involving bit casts) resulting from the recent -Wuninitialized changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/uninit-variables.cpp')
-rw-r--r--test/SemaCXX/uninit-variables.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/uninit-variables.cpp b/test/SemaCXX/uninit-variables.cpp
index 6c5d0068a4..9abccf0751 100644
--- a/test/SemaCXX/uninit-variables.cpp
+++ b/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}}
+}
+