[all-commits] [llvm/llvm-project] f27f22: [clang-tidy] Added bugprone-inc-dec-in-conditions ...

Piotr Zegar via All-commits all-commits at lists.llvm.org
Sun Jul 30 06:20:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f27f22b34516dcb744077710c19d475367e3ef03
      https://github.com/llvm/llvm-project/commit/f27f22b34516dcb744077710c19d475367e3ef03
  Author: Piotr Zegar <piotr.zegar at nokia.com>
  Date:   2023-07-30 (Sun, 30 Jul 2023)

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

  Log Message:
  -----------
  [clang-tidy] Added bugprone-inc-dec-in-conditions check

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.

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D149015




More information about the All-commits mailing list