diff options
Diffstat (limited to 'clang/test/Analysis/use-after-move.cpp')
-rw-r--r-- | clang/test/Analysis/use-after-move.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/test/Analysis/use-after-move.cpp b/clang/test/Analysis/use-after-move.cpp index ac4222bc776..e58301df8b5 100644 --- a/clang/test/Analysis/use-after-move.cpp +++ b/clang/test/Analysis/use-after-move.cpp @@ -242,10 +242,12 @@ void reinitializationTest(int i) { } { A a; - if (i == 1) { // peaceful-note 2 {{Taking false branch}} + if (i == 1) { // peaceful-note 2 {{'i' is not equal to 1}} + // peaceful-note@-1 2 {{Taking false branch}} std::move(a); } - if (i == 2) { // peaceful-note 2 {{Taking false branch}} + if (i == 2) { // peaceful-note 2 {{'i' is not equal to 2}} + // peaceful-note@-1 2 {{Taking false branch}} a = A(); a.foo(); } @@ -276,7 +278,8 @@ void reinitializationTest(int i) { // peaceful-note@-1 {{Taking false branch}} a = A(); } - if (i > 5) { // peaceful-note {{Taking true branch}} + if (i > 5) { // peaceful-note {{'i' is > 5}} + // peaceful-note@-1 {{Taking true branch}} a.foo(); // peaceful-warning {{Method called on moved-from object 'a'}} // peaceful-note@-1 {{Method called on moved-from object 'a'}} } @@ -559,7 +562,9 @@ void differentBranchesTest(int i) { // Same thing, but with a ternary operator. { A a, b; - i > 0 ? (void)(b = std::move(a)) : a.bar(); // no-warning // peaceful-note {{'?' condition is true}} + i > 0 ? (void)(b = std::move(a)) : a.bar(); // no-warning + // peaceful-note@-1 {{'i' is > 0}} + // peaceful-note@-2 {{'?' condition is true}} } // A variation on the theme above. { |