[PATCH] D149015: [clang-tidy] Added bugprone-inc-dec-in-conditions check

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 23 02:43:34 PDT 2023


PiotrZSL created this revision.
PiotrZSL added reviewers: njames93, carlosgalvezp.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
PiotrZSL requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Detects when a variable is both incremented/decremented and referenced inside a
complex condition and suggests moving them outside to avoid ambiguity in the
variable's value.

Depends on D148995 <https://reviews.llvm.org/D148995>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149015

Files:
  clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
  clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
  clang-tools-extra/clang-tidy/bugprone/IncDecInConditionsCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/IncDecInConditionsCheck.h
  clang-tools-extra/clang-tidy/utils/CMakeLists.txt
  clang-tools-extra/clang-tidy/utils/Matchers.cpp
  clang-tools-extra/clang-tidy/utils/Matchers.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/bugprone/inc-dec-in-conditions.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/test/clang-tidy/checkers/bugprone/inc-dec-in-conditions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149015.516134.patch
Type: text/x-patch
Size: 19266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230423/cbad4167/attachment-0001.bin>


More information about the cfe-commits mailing list