https://github.com/benedekaibas updated https://github.com/llvm/llvm-project/pull/236804
>From 5d89b17352c3f9e8454860d744b5d4b637bb62e9 Mon Sep 17 00:00:00 2001 From: benedekaibas <[email protected]> Date: Thu, 29 Oct 2026 15:58:40 +0100 Subject: [PATCH 1/3] [analyzer] Standardize loop body notes in BugReporter --- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 4 ++-- clang/test/Analysis/dangling-ptr-deref.cpp | 2 +- .../diagnostics/track_subexpressions.cpp | 4 ++-- clang/test/Analysis/loop-widening-notes.cpp | 8 +++---- clang/test/Analysis/loop-widening.cpp | 4 ++-- clang/test/Analysis/return-ptr-range.cpp | 4 ++-- .../track-control-dependency-conditions.cpp | 6 ++--- clang/test/Analysis/use-after-move.cpp | 24 +++++++++---------- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 25d10df604bda1..a3d77c4971b3d4 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -972,7 +972,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge( C.getActivePath().push_front( std::make_shared<PathDiagnosticControlFlowPiece>( - Start, End, "Loop condition is false. Exiting loop")); + Start, End, "Loop condition is false; exiting loop")); } break; @@ -996,7 +996,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge( C.getActivePath().push_front( std::make_shared<PathDiagnosticControlFlowPiece>( - Start, End, "Loop condition is true. Entering loop body")); + Start, End, "Loop condition is true; entering loop body")); } break; diff --git a/clang/test/Analysis/dangling-ptr-deref.cpp b/clang/test/Analysis/dangling-ptr-deref.cpp index 8572b6416f150f..f512425aeb5097 100644 --- a/clang/test/Analysis/dangling-ptr-deref.cpp +++ b/clang/test/Analysis/dangling-ptr-deref.cpp @@ -72,7 +72,7 @@ void test_case_six() { void test_case_seven() { int *ptr = nullptr; - // expected-note@+3 {{Loop condition is true. Entering loop body}} + // expected-note@+3 {{Loop condition is true; entering loop body}} // expected-note@+2 {{Assuming 'i' is >= 10}} // expected-note@+1 {{Loop condition is false. Execution continues on line}} for (int i = 0; i < 10; ++i) { // expected-note {{'i' initialized to 0}} diff --git a/clang/test/Analysis/diagnostics/track_subexpressions.cpp b/clang/test/Analysis/diagnostics/track_subexpressions.cpp index c61738ce7b136d..3b5d389ca154e3 100644 --- a/clang/test/Analysis/diagnostics/track_subexpressions.cpp +++ b/clang/test/Analysis/diagnostics/track_subexpressions.cpp @@ -37,7 +37,7 @@ void testArrayIndexTracking() { int arr[10]; for (int i = 0; i < 3; ++i) - // expected-note@-1 3{{Loop condition is true. Entering loop body}} + // expected-note@-1 3{{Loop condition is true; entering loop body}} // expected-note@-2 {{Loop condition is false. Execution continues on line 43}} arr[i] = 0; int x = getInt(); @@ -69,7 +69,7 @@ void testArrayIndexTracking() { int arr[2][10]; for (int i = 0; i < 3; ++i) - // expected-note@-1 3{{Loop condition is true. Entering loop body}} + // expected-note@-1 3{{Loop condition is true; entering loop body}} // expected-note@-2 {{Loop condition is false. Execution continues on line 75}} arr[1][i] = 0; int x = getInt(); diff --git a/clang/test/Analysis/loop-widening-notes.cpp b/clang/test/Analysis/loop-widening-notes.cpp index a3f030dfe98826..d16ac61e040d0c 100644 --- a/clang/test/Analysis/loop-widening-notes.cpp +++ b/clang/test/Analysis/loop-widening-notes.cpp @@ -7,7 +7,7 @@ int test_for_bug_25609() { if (p_a == 0) // expected-note {{Assuming 'p_a' is equal to null}} // expected-note@-1 {{Taking true branch}} bar(); - for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}} + for (int i = 0; // expected-note {{Loop condition is true; entering loop body}} // expected-note@-1 {{Loop condition is false. Execution continues on line 16}} ++i, // expected-note {{Value assigned to 'p_a'}} i < flag_a; @@ -22,7 +22,7 @@ int flag_b; int while_analyzer_output() { flag_b = 100; int num = 10; - while (flag_b-- > 0) { // expected-note {{Loop condition is true. Entering loop body}} + while (flag_b-- > 0) { // expected-note {{Loop condition is true; entering loop body}} // expected-note@-1 {{Value assigned to 'num'}} // expected-note@-2 {{Loop condition is false. Execution continues on line 30}} num = flag_b; @@ -43,7 +43,7 @@ int flag_c; int do_while_analyzer_output() { int num = 10; do { // expected-note {{Loop condition is true. Execution continues on line 47}} - // expected-note@-1 {{Loop condition is false. Exiting loop}} + // expected-note@-1 {{Loop condition is false; exiting loop}} num--; } while (flag_c-- > 0); //expected-note {{Value assigned to 'num'}} int local = 0; @@ -57,7 +57,7 @@ int do_while_analyzer_output() { int flag_d; int test_for_loop() { int num = 10; - for (int i = 0; // expected-note {{Loop condition is true. Entering loop body}} + for (int i = 0; // expected-note {{Loop condition is true; entering loop body}} // expected-note@-1 {{Loop condition is false. Execution continues on line 67}} new int(10), // expected-note {{Value assigned to 'num'}} i < flag_d; diff --git a/clang/test/Analysis/loop-widening.cpp b/clang/test/Analysis/loop-widening.cpp index fbcb72dee160ae..6b56110292cc10 100644 --- a/clang/test/Analysis/loop-widening.cpp +++ b/clang/test/Analysis/loop-widening.cpp @@ -14,8 +14,8 @@ void fn1() { A a; A *b = &a; - for (;;) { // expected-note{{Loop condition is true. Entering loop body}} - // expected-note@-1{{Loop condition is true. Entering loop body}} + for (;;) { // expected-note{{Loop condition is true; entering loop body}} + // expected-note@-1{{Loop condition is true; entering loop body}} // expected-note@-2{{Value assigned to 'b'}} // no crash during bug report construction diff --git a/clang/test/Analysis/return-ptr-range.cpp b/clang/test/Analysis/return-ptr-range.cpp index 507720a47ea7d5..a60bced521057b 100644 --- a/clang/test/Analysis/return-ptr-range.cpp +++ b/clang/test/Analysis/return-ptr-range.cpp @@ -8,7 +8,7 @@ int arr[10]; // expected-note{{Original object declared here}} expected-note{{Or int *ptr; int *test_global_ptr() { - do { // expected-note{{Loop condition is false. Exiting loop}} + do { // expected-note{{Loop condition is false; exiting loop}} int x = conjure_index(); ptr = arr + x; // expected-note{{Value assigned to 'ptr'}} if (x != 20) // expected-note{{Assuming 'x' is equal to 20}} @@ -22,7 +22,7 @@ int *test_global_ptr() { int *test_local_ptr() { int *local_ptr; - do { // expected-note{{Loop condition is false. Exiting loop}} + do { // expected-note{{Loop condition is false; exiting loop}} int x = conjure_index(); local_ptr = arr + x; // expected-note{{Value assigned to 'local_ptr'}} if (x != 20) // expected-note{{Assuming 'x' is equal to 20}} diff --git a/clang/test/Analysis/track-control-dependency-conditions.cpp b/clang/test/Analysis/track-control-dependency-conditions.cpp index b762992b6a8f0b..75bde938f0c795 100644 --- a/clang/test/Analysis/track-control-dependency-conditions.cpp +++ b/clang/test/Analysis/track-control-dependency-conditions.cpp @@ -858,7 +858,7 @@ void f(int flag) { bar(); assert(cond1); // expected-note-re{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}} // expected-note-re@-1{{{{^}}Taking false branch{{$}}}} - // expected-note-re@-2{{{{^}}Loop condition is false. Exiting loop{{$}}}} + // expected-note-re@-2{{{{^}}Loop condition is false; exiting loop{{$}}}} if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}} // expected-note-re@-1{{{{^}}Taking true branch{{$}}}} @@ -902,7 +902,7 @@ void f(int flag) { // expected-note-re@-2{{{{^}}Left side of '&&' is true{{$}}}} // expected-note-re@-3{{{{^}}Assuming the condition is false{{$}}}} // expected-note-re@-4{{{{^}}Taking false branch{{$}}}} - // expected-note-re@-5{{{{^}}Loop condition is false. Exiting loop{{$}}}} + // expected-note-re@-5{{{{^}}Loop condition is false; exiting loop{{$}}}} if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}} // expected-note-re@-1{{{{^}}Taking true branch{{$}}}} @@ -945,7 +945,7 @@ void f(int flag) { // expected-note-re@-1{{{{^}}Assuming 'cond1' is not equal to 0{{$}}}} // expected-note-re@-2{{{{^}}Left side of '||' is true{{$}}}} // expected-note-re@-3{{{{^}}Taking false branch{{$}}}} - // expected-note-re@-4{{{{^}}Loop condition is false. Exiting loop{{$}}}} + // expected-note-re@-4{{{{^}}Loop condition is false; exiting loop{{$}}}} if (flag) // expected-note-re{{{{^}}Assuming 'flag' is not equal to 0{{$}}}} // expected-note-re@-1{{{{^}}Taking true branch{{$}}}} diff --git a/clang/test/Analysis/use-after-move.cpp b/clang/test/Analysis/use-after-move.cpp index fa7893c9a21c8b..bfbc98a746c005 100644 --- a/clang/test/Analysis/use-after-move.cpp +++ b/clang/test/Analysis/use-after-move.cpp @@ -303,8 +303,8 @@ void loopTest() { } { A a; - for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}} - // peaceful-note@-1 {{Loop condition is true. Entering loop body}} + for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} + // peaceful-note@-1 {{Loop condition is true; entering loop body}} // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} rightRefCall(std::move(a)); // no-warning } @@ -317,8 +317,8 @@ void loopTest() { } { A a; - for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}} - // peaceful-note@-1 {{Loop condition is true. Entering loop body}} + for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} + // peaceful-note@-1 {{Loop condition is true; entering loop body}} // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} leftRefCall(a); // no-warning } @@ -331,8 +331,8 @@ void loopTest() { } { A a; - for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}} - // peaceful-note@-1 {{Loop condition is true. Entering loop body}} + for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} + // peaceful-note@-1 {{Loop condition is true; entering loop body}} // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} constCopyOrMoveCall(a); // no-warning } @@ -345,8 +345,8 @@ void loopTest() { } { A a; - for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}} - // peaceful-note@-1 {{Loop condition is true. Entering loop body}} + for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} + // peaceful-note@-1 {{Loop condition is true; entering loop body}} // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} moveInsideFunctionCall(a); // no-warning } @@ -359,16 +359,16 @@ void loopTest() { } { A a; - for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true. Entering loop body}} - // peaceful-note@-1 {{Loop condition is true. Entering loop body}} + for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} + // peaceful-note@-1 {{Loop condition is true; entering loop body}} // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} copyOrMoveCall(a); // no-warning } } { A a; - for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is true. Entering loop body}} - // peaceful-note@-1 {{Loop condition is true. Entering loop body}} + for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is true; entering loop body}} + // peaceful-note@-1 {{Loop condition is true; entering loop body}} constCopyOrMoveCall(std::move(a)); // peaceful-note {{Object 'a' is moved}} // peaceful-warning@-1 {{Moved-from object 'a' is moved}} // peaceful-note@-2 {{Moved-from object 'a' is moved}} >From be3aee3315cc0e25aef328684219cfd401a11acd Mon Sep 17 00:00:00 2001 From: benedekaibas <[email protected]> Date: Thu, 29 Oct 2026 16:07:53 +0100 Subject: [PATCH 2/3] Add verbose-tests.c as well. --- clang/test/Analysis/ArrayBound/verbose-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/test/Analysis/ArrayBound/verbose-tests.c b/clang/test/Analysis/ArrayBound/verbose-tests.c index 29e80947d2f541..d88688bfd27412 100644 --- a/clang/test/Analysis/ArrayBound/verbose-tests.c +++ b/clang/test/Analysis/ArrayBound/verbose-tests.c @@ -65,7 +65,7 @@ void gh86959(void) { // Previously code like this produced many almost-identical bug reports that // only differed in the offset value. Verify that now we only see one report. - // expected-note@+1 {{Entering loop body}} + // expected-note@+1 {{entering loop body}} while (rng()) TenElements[getIndex()] = 10; // expected-warning@-1 {{Out of bound access to memory preceding 'TenElements'}} >From 7071d00aaa5196b0b35caf224a3b584e05ad9894 Mon Sep 17 00:00:00 2001 From: benedekaibas <[email protected]> Date: Mon, 2 Nov 2026 00:13:19 +0100 Subject: [PATCH 3/3] Complete BugReporter changes and avoid regression. --- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 28 +++++++++++-------- ...eckThatArraySubsciptNodeIsNotCollected.cpp | 2 +- clang/test/Analysis/dangling-ptr-deref.cpp | 2 +- .../diagnostics/track_subexpressions.cpp | 4 +-- clang/test/Analysis/loop-widening-notes.cpp | 8 +++--- clang/test/Analysis/use-after-move.cpp | 20 ++++++------- 6 files changed, 35 insertions(+), 29 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index a3d77c4971b3d4..55b880decce86a 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -620,17 +620,24 @@ PathDiagnosticLocation PathDiagnosticBuilder::ExecutionContinues( PathDiagnosticLocation PathDiagnosticBuilder::ExecutionContinues( llvm::raw_string_ostream &os, const PathDiagnosticConstruct &C) const { // Slow, but probably doesn't matter. - if (os.str().empty()) + bool isEmpty = os.str().empty(); + if (isEmpty) os << ' '; const PathDiagnosticLocation &Loc = ExecutionContinues(C); - if (Loc.asStmt()) - os << "Execution continues on line " - << getSourceManager().getExpansionLineNumber(Loc.asLocation()) - << '.'; - else { - os << "Execution jumps to the end of the "; + if (Loc.asStmt()) { + if (!isEmpty) + os << "execution continues on line " + << getSourceManager().getExpansionLineNumber(Loc.asLocation()); + else + os << "Execution continues on line " + << getSourceManager().getExpansionLineNumber(Loc.asLocation()); + } else { + if (!isEmpty) + os << "execution jumps to the end of the "; + else + os << "Execution jumps to the end of the "; const Decl *D = C.getCurrStackFrame()->getDecl(); if (isa<ObjCMethodDecl>(D)) os << "method"; @@ -640,7 +647,6 @@ PathDiagnosticLocation PathDiagnosticBuilder::ExecutionContinues( assert(isa<BlockDecl>(D)); os << "anonymous block"; } - os << '.'; } return Loc; @@ -821,7 +827,7 @@ PathDiagnosticPieceRef PathDiagnosticBuilder::generateDiagForSwitchOP( } } } else { - os << "'Default' branch taken. "; + os << "'Default' branch taken; "; End = ExecutionContinues(os, C); } return std::make_shared<PathDiagnosticControlFlowPiece>(Start, End, sbuf); @@ -956,7 +962,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge( std::string sbuf; llvm::raw_string_ostream os(sbuf); - os << "Loop condition is true. "; + os << "Loop condition is true; "; PathDiagnosticLocation End = ExecutionContinues(os, C); if (const Stmt *S = End.asStmt()) @@ -982,7 +988,7 @@ void PathDiagnosticBuilder::generateMinimalDiagForBlockEdge( std::string sbuf; llvm::raw_string_ostream os(sbuf); - os << "Loop condition is false. "; + os << "Loop condition is false; "; PathDiagnosticLocation End = ExecutionContinues(os, C); if (const Stmt *S = End.asStmt()) End = getEnclosingStmtLocation(S, C.getCurrStackFrame()); diff --git a/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp b/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp index b1c0f339bd56cb..8fe4e4d5eb8506 100644 --- a/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp +++ b/clang/test/Analysis/CheckThatArraySubsciptNodeIsNotCollected.cpp @@ -22,7 +22,7 @@ void test() { A *array[42]; A *found; - for (index = 0; (array[index] = foo()); ++index) { // expected-note {{Loop condition is false. Execution continues on line 34}} + for (index = 0; (array[index] = foo()); ++index) { // expected-note {{Loop condition is false; execution continues on line 34}} // expected-note@-1 {{Value assigned to 'index'}} // expected-note@-2 {{Assigning value}} // expected-note@-3 {{Assuming pointer value is null}} diff --git a/clang/test/Analysis/dangling-ptr-deref.cpp b/clang/test/Analysis/dangling-ptr-deref.cpp index f512425aeb5097..d0e6c1c9e700ed 100644 --- a/clang/test/Analysis/dangling-ptr-deref.cpp +++ b/clang/test/Analysis/dangling-ptr-deref.cpp @@ -74,7 +74,7 @@ void test_case_seven() { int *ptr = nullptr; // expected-note@+3 {{Loop condition is true; entering loop body}} // expected-note@+2 {{Assuming 'i' is >= 10}} - // expected-note@+1 {{Loop condition is false. Execution continues on line}} + // expected-note@+1 {{Loop condition is false; execution continues on line}} for (int i = 0; i < 10; ++i) { // expected-note {{'i' initialized to 0}} ptr = &i; // expected-note {{Value assigned to 'ptr'}} escape(ptr); diff --git a/clang/test/Analysis/diagnostics/track_subexpressions.cpp b/clang/test/Analysis/diagnostics/track_subexpressions.cpp index 3b5d389ca154e3..ec80405d457c15 100644 --- a/clang/test/Analysis/diagnostics/track_subexpressions.cpp +++ b/clang/test/Analysis/diagnostics/track_subexpressions.cpp @@ -38,7 +38,7 @@ void testArrayIndexTracking() { for (int i = 0; i < 3; ++i) // expected-note@-1 3{{Loop condition is true; entering loop body}} - // expected-note@-2 {{Loop condition is false. Execution continues on line 43}} + // expected-note@-2 {{Loop condition is false; execution continues on line 43}} arr[i] = 0; int x = getInt(); int n = getIndex(x); // expected-note {{Calling 'getIndex'}} @@ -70,7 +70,7 @@ void testArrayIndexTracking() { for (int i = 0; i < 3; ++i) // expected-note@-1 3{{Loop condition is true; entering loop body}} - // expected-note@-2 {{Loop condition is false. Execution continues on line 75}} + // expected-note@-2 {{Loop condition is false; execution continues on line 75}} arr[1][i] = 0; int x = getInt(); int n = getIndex(x); // expected-note {{Calling 'getIndex'}} diff --git a/clang/test/Analysis/loop-widening-notes.cpp b/clang/test/Analysis/loop-widening-notes.cpp index d16ac61e040d0c..3ffe2331b9ae5c 100644 --- a/clang/test/Analysis/loop-widening-notes.cpp +++ b/clang/test/Analysis/loop-widening-notes.cpp @@ -8,7 +8,7 @@ int test_for_bug_25609() { // expected-note@-1 {{Taking true branch}} bar(); for (int i = 0; // expected-note {{Loop condition is true; entering loop body}} - // expected-note@-1 {{Loop condition is false. Execution continues on line 16}} + // expected-note@-1 {{Loop condition is false; execution continues on line 16}} ++i, // expected-note {{Value assigned to 'p_a'}} i < flag_a; ++i) {} @@ -24,7 +24,7 @@ int while_analyzer_output() { int num = 10; while (flag_b-- > 0) { // expected-note {{Loop condition is true; entering loop body}} // expected-note@-1 {{Value assigned to 'num'}} - // expected-note@-2 {{Loop condition is false. Execution continues on line 30}} + // expected-note@-2 {{Loop condition is false; execution continues on line 30}} num = flag_b; } if (num < 0) // expected-note {{Assuming 'num' is >= 0}} @@ -42,7 +42,7 @@ int while_analyzer_output() { int flag_c; int do_while_analyzer_output() { int num = 10; - do { // expected-note {{Loop condition is true. Execution continues on line 47}} + do { // expected-note {{Loop condition is true; execution continues on line 47}} // expected-note@-1 {{Loop condition is false; exiting loop}} num--; } while (flag_c-- > 0); //expected-note {{Value assigned to 'num'}} @@ -58,7 +58,7 @@ int flag_d; int test_for_loop() { int num = 10; for (int i = 0; // expected-note {{Loop condition is true; entering loop body}} - // expected-note@-1 {{Loop condition is false. Execution continues on line 67}} + // expected-note@-1 {{Loop condition is false; execution continues on line 67}} new int(10), // expected-note {{Value assigned to 'num'}} i < flag_d; ++i) { diff --git a/clang/test/Analysis/use-after-move.cpp b/clang/test/Analysis/use-after-move.cpp index bfbc98a746c005..f122f32c34bfdf 100644 --- a/clang/test/Analysis/use-after-move.cpp +++ b/clang/test/Analysis/use-after-move.cpp @@ -297,7 +297,7 @@ void loopTest() { { A a; // FIXME: Execution doesn't jump to the end of the function yet. - for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}} + for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}} rightRefCall(std::move(a)); // no-warning } } @@ -305,13 +305,13 @@ void loopTest() { A a; for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} // peaceful-note@-1 {{Loop condition is true; entering loop body}} - // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} + // peaceful-note@-2 {{Loop condition is false; execution jumps to the end of the function}} rightRefCall(std::move(a)); // no-warning } } { A a; - for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}} + for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}} leftRefCall(a); // no-warning } } @@ -319,13 +319,13 @@ void loopTest() { A a; for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} // peaceful-note@-1 {{Loop condition is true; entering loop body}} - // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} + // peaceful-note@-2 {{Loop condition is false; execution jumps to the end of the function}} leftRefCall(a); // no-warning } } { A a; - for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}} + for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}} constCopyOrMoveCall(a); // no-warning } } @@ -333,13 +333,13 @@ void loopTest() { A a; for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} // peaceful-note@-1 {{Loop condition is true; entering loop body}} - // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} + // peaceful-note@-2 {{Loop condition is false; execution jumps to the end of the function}} constCopyOrMoveCall(a); // no-warning } } { A a; - for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}} + for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}} moveInsideFunctionCall(a); // no-warning } } @@ -347,13 +347,13 @@ void loopTest() { A a; for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} // peaceful-note@-1 {{Loop condition is true; entering loop body}} - // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} + // peaceful-note@-2 {{Loop condition is false; execution jumps to the end of the function}} moveInsideFunctionCall(a); // no-warning } } { A a; - for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false. Execution jumps to the end of the function}} + for (int i = 0; i < bignum(); i++) { // peaceful-note {{Loop condition is false; execution jumps to the end of the function}} copyOrMoveCall(a); // no-warning } } @@ -361,7 +361,7 @@ void loopTest() { A a; for (int i = 0; i < 2; i++) { // peaceful-note {{Loop condition is true; entering loop body}} // peaceful-note@-1 {{Loop condition is true; entering loop body}} - // peaceful-note@-2 {{Loop condition is false. Execution jumps to the end of the function}} + // peaceful-note@-2 {{Loop condition is false; execution jumps to the end of the function}} copyOrMoveCall(a); // no-warning } } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
