HomePhabricator

[clang-tidy] new check: bugprone-branch-clone

Authored by Kristof Umann <kristof.umann@ericsson.com> on May 15 2019, 8:06 AM.

Description

[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

Event Timeline

Kristof Umann <kristof.umann@ericsson.com> committed rG7f7dd0900130: [clang-tidy] new check: bugprone-branch-clone (authored by Kristof Umann <kristof.umann@ericsson.com>).May 15 2019, 8:06 AM