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

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 29 13:53:47 PST 2018


Eugene.Zelenko added inline comments.


================
Comment at: test/clang-tidy/bugprone-branch-clone.cpp:4
+void test_basic1(int in, int &out) {
+  if (in > 77)
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone]
----------------
donat.nagy wrote:
> JonasToth wrote:
> > donat.nagy wrote:
> > > JonasToth wrote:
> > > > could you please add tests for ternary operators?
> > > Currently the check does not handle ternary operators, but I added some checks reflecting this.
> > Thank you. Could you please add a short note to the user-facing documentation that these are not handled.
> In fact, I could easily extend the functionality of the checker to cover ternary operators. Would it be an useful addition?
Sure, it'll be great extension of functionality.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54757/new/

https://reviews.llvm.org/D54757





More information about the cfe-commits mailing list