diff options
author | Richard Trieu <rtrieu@google.com> | 2012-06-14 23:11:34 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2012-06-14 23:11:34 +0000 |
commit | de5e75caac71d4cfeb9d04cd10281176f43579d6 (patch) | |
tree | fdac654e49b769905a76960aa5308c44b2954830 /test/SemaCXX/constructor-initializer.cpp | |
parent | 1dfbd92c83699820bfaa352e83083124e34fc9dc (diff) |
Use a proper visitor to recursively check for uninitialized use in constructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/constructor-initializer.cpp')
-rw-r--r-- | test/SemaCXX/constructor-initializer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp index e8b7f0b676..1a4e54444f 100644 --- a/test/SemaCXX/constructor-initializer.cpp +++ b/test/SemaCXX/constructor-initializer.cpp @@ -126,21 +126,24 @@ struct Q { // A silly class used to demonstrate field-is-uninitialized in constructors with // multiple params. +int IntParam(int i) { return 0; }; class TwoInOne { public: TwoInOne(TwoInOne a, TwoInOne b) {} }; class InitializeUsingSelfTest { bool A; char* B; int C; TwoInOne D; - InitializeUsingSelfTest(int E) + int E; + InitializeUsingSelfTest(int F) : A(A), // expected-warning {{field is uninitialized when used here}} B((((B)))), // expected-warning {{field is uninitialized when used here}} C(A && InitializeUsingSelfTest::C), // expected-warning {{field is uninitialized when used here}} D(D, // expected-warning {{field is uninitialized when used here}} - D) {} // expected-warning {{field is uninitialized when used here}} + D), // expected-warning {{field is uninitialized when used here}} + E(IntParam(E)) {} // expected-warning {{field is uninitialized when used here}} }; -int IntWrapper(int i) { return 0; }; +int IntWrapper(int &i) { return 0; }; class InitializeUsingSelfExceptions { int A; int B; |