diff options
author | Richard Trieu <rtrieu@google.com> | 2012-03-08 01:15:31 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2012-03-08 01:15:31 +0000 |
commit | 978dfc0d1e27e5d2a0966a407333b4fe18644a41 (patch) | |
tree | 31ad90673fd23883c021971ca70ad4daa49c1bdb /clang/test/SemaCXX/uninitialized.cpp | |
parent | 8dbcfc39cd24ae785768044faf38b519fe769577 (diff) | |
download | bcm5719-llvm-978dfc0d1e27e5d2a0966a407333b4fe18644a41.tar.gz bcm5719-llvm-978dfc0d1e27e5d2a0966a407333b4fe18644a41.zip |
Fix -Wuninitialized to catch the case of a class being initialized with a call
to its own member function.
llvm-svn: 152276
Diffstat (limited to 'clang/test/SemaCXX/uninitialized.cpp')
-rw-r--r-- | clang/test/SemaCXX/uninitialized.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp index ec037cbb781..95506829180 100644 --- a/clang/test/SemaCXX/uninitialized.cpp +++ b/clang/test/SemaCXX/uninitialized.cpp @@ -33,6 +33,7 @@ class A { int num; static int count; int get() const { return num; } + int get2() { return num; } void set(int x) { num = x; } static int zero() { return 0; } @@ -67,6 +68,7 @@ void setupA() { A a14 = A(a14); // expected-warning {{variable 'a14' is uninitialized when used within its own initialization}} A a15 = getA(a15.num); // expected-warning {{variable 'a15' is uninitialized when used within its own initialization}} A a16(&a16.num); // expected-warning {{variable 'a16' is uninitialized when used within its own initialization}} + A a17(a17.get2()); // expected-warning {{variable 'a17' is uninitialized when used within its own initialization}} } struct B { |