================ @@ -0,0 +1,48 @@ +.. title:: clang-tidy - bugprone-loop-variable-copied-then-modified + +bugprone-loop-variable-copied-then-modified +=========================================== + +Detects when a loop variable is copied and then subsequently modified and +suggests replacing with a ``const`` reference or an explicit copy. + +This pattern is considered bugprone because, frequently, programmers do not +realize that they are modifying a *copy* rather than an underlying value, +resulting in subtly erroneous code. + +For instance, the following code attempts to null out a value in a map, but only +succeeds in ---------------- nicovank wrote:
End of sentence missing. https://github.com/llvm/llvm-project/pull/157213 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits