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 | 4fc853681f103c149ebb8b1d939405ceacd3c746 (patch) | |
tree | 35043504c6ca952d057ef1f478ed6109b70ac92f /clang/test/SemaCXX/constructor-initializer.cpp | |
parent | def1b09be283f4318ee2488ae7e4f492bda400a0 (diff) | |
download | bcm5719-llvm-4fc853681f103c149ebb8b1d939405ceacd3c746.tar.gz bcm5719-llvm-4fc853681f103c149ebb8b1d939405ceacd3c746.zip |
Use a proper visitor to recursively check for uninitialized use in constructors.
llvm-svn: 158477
Diffstat (limited to 'clang/test/SemaCXX/constructor-initializer.cpp')
-rw-r--r-- | clang/test/SemaCXX/constructor-initializer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp index e8b7f0b6760..1a4e54444f4 100644 --- a/clang/test/SemaCXX/constructor-initializer.cpp +++ b/clang/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; |