This is an archive of the discontinued LLVM Phabricator instance.

[private][clang-tidy] New bugprone-loop-variable-mutations check
AbandonedPublic

Authored by lebedev.ri on Sep 10 2018, 11:00 AM.

Details

Reviewers
None
Summary

Not quite ready for the review.
Lacks tests, docs.

Needs PR38890 to be resolved first, to get rid of the ExprMutationAnalyzer false-positives.

Also, currently mishandles cases like

std::pair<int, int> a {0, 0};
for (a.first = 0; a.first < 10; a.first++)
  a.second = 0;

but maybe this is not ExprMutationAnalyzer's problem..

Submitting as a differential just as a backup :D

Diff Detail