summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/uninitialized.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-09-30 23:04:37 +0000
committerRichard Trieu <rtrieu@google.com>2014-09-30 23:04:37 +0000
commit9f8509f70d0cdec5cb1f4c69a0f218db1a2966d3 (patch)
tree1ef7693d20ed1aab18b105141e0fc24f8d78d3b3 /clang/test/SemaCXX/uninitialized.cpp
parentfd8631798970c5b527ec2ad071fe1582e5146ab5 (diff)
downloadbcm5719-llvm-9f8509f70d0cdec5cb1f4c69a0f218db1a2966d3.tar.gz
bcm5719-llvm-9f8509f70d0cdec5cb1f4c69a0f218db1a2966d3.zip
Update -Wuninitialized to be stricter on CK_NoOp casts.
llvm-svn: 218715
Diffstat (limited to 'clang/test/SemaCXX/uninitialized.cpp')
-rw-r--r--clang/test/SemaCXX/uninitialized.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp
index a7997e4268c..f1825ba5d1f 100644
--- a/clang/test/SemaCXX/uninitialized.cpp
+++ b/clang/test/SemaCXX/uninitialized.cpp
@@ -150,6 +150,7 @@ A getA(int x) { return A(); }
A getA(A* a) { return A(); }
A getA(A a) { return A(); }
A moveA(A&& a) { return A(); }
+A const_refA(const A& a) { return A(); }
void setupA(bool x) {
A a1;
@@ -195,6 +196,13 @@ void setupA(bool x) {
A a33 = A(std::move(a33)); // expected-warning {{variable 'a33' is uninitialized when used within its own initialization}}
A a34(std::move(a34)); // expected-warning {{variable 'a34' is uninitialized when used within its own initialization}}
A a35 = std::move(x ? a34 : (37, a35)); // expected-warning {{variable 'a35' is uninitialized when used within its own initialization}}
+
+ A a36 = const_refA(a36);
+ A a37(const_refA(a37));
+
+ A a38({a38}); // expected-warning {{variable 'a38' is uninitialized when used within its own initialization}}
+ A a39 = {a39}; // expected-warning {{variable 'a39' is uninitialized when used within its own initialization}}
+ A a40 = A({a40}); // expected-warning {{variable 'a40' is uninitialized when used within its own initialization}}
}
bool cond;
@@ -239,6 +247,14 @@ A a32 = moveA(std::move(a32)); // expected-warning {{variable 'a32' is uninitia
A a33 = A(std::move(a33)); // expected-warning {{variable 'a33' is uninitialized when used within its own initialization}}
A a34(std::move(a34)); // expected-warning {{variable 'a34' is uninitialized when used within its own initialization}}
A a35 = std::move(x ? a34 : (37, a35)); // expected-warning {{variable 'a35' is uninitialized when used within its own initialization}}
+
+A a36 = const_refA(a36);
+A a37(const_refA(a37));
+
+A a38({a38}); // expected-warning {{variable 'a38' is uninitialized when used within its own initialization}}
+A a39 = {a39}; // expected-warning {{variable 'a39' is uninitialized when used within its own initialization}}
+A a40 = A({a40}); // expected-warning {{variable 'a40' is uninitialized when used within its own initialization}}
+
struct B {
// POD struct.
int x;
OpenPOWER on IntegriCloud