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 | ffea6b4560cee39bd2a26f478e57da19fc3b47b2 (patch) | |
tree | 4d2c53022abb4edd58f76933dbd6f4f2dfed1ca7 /test/SemaCXX/uninitialized.cpp | |
parent | 29f98b40caabca1ec820d546c5c08206a1d4f520 (diff) |
Fix -Wuninitialized to catch the case of a class being initialized with a call
to its own member function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/uninitialized.cpp')
-rw-r--r-- | test/SemaCXX/uninitialized.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/SemaCXX/uninitialized.cpp b/test/SemaCXX/uninitialized.cpp index ec037cbb78..9550682918 100644 --- a/test/SemaCXX/uninitialized.cpp +++ b/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 { |