summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/uninit-variables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/uninit-variables.cpp')
-rw-r--r--test/SemaCXX/uninit-variables.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/uninit-variables.cpp b/test/SemaCXX/uninit-variables.cpp
index eb6428d..687bfd2 100644
--- a/test/SemaCXX/uninit-variables.cpp
+++ b/test/SemaCXX/uninit-variables.cpp
@@ -141,3 +141,9 @@ void test_bitcasts_2() {
int y = (float &)x; // expected-warning {{uninitialized when used here}}
}
+void consume_const_ref(const int &n);
+int test_const_ref() {
+ int n; // expected-note {{variable}}
+ consume_const_ref(n);
+ return n; // expected-warning {{uninitialized when used here}}
+}
OpenPOWER on IntegriCloud