summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/uninit-variables.cpp
diff options
context:
space:
mode:
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