[clang-tidy] new check: bugprone-branch-clone
authorKristof Umann <kristof.umann@ericsson.com>
Wed, 15 May 2019 15:06:25 +0000 (15:06 +0000)
committerKristof Umann <kristof.umann@ericsson.com>
Wed, 15 May 2019 15:06:25 +0000 (15:06 +0000)
commit7f7dd09001301edf328b7e01c30c8bb03bdc8c57
tree7001ff27d6577287158604f9a06d34da098d74a8
parent29257eb76c8dc733d48a16765c621e5af21a8247
[clang-tidy] new check: bugprone-branch-clone

Implement a check for detecting if/else if/else chains where two or more
branches are Type I clones of each other (that is, they contain identical code)
and for detecting switch statements where two or more consecutive branches are
Type I clones of each other.

Patch by DonĂ¡t Nagy!

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

llvm-svn: 360779
clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.h [new file with mode: 0644]
clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/bugprone-branch-clone.cpp [new file with mode: 0644]