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

DonĂ¡t Nagy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 29 13:50:38 PST 2018


donat.nagy marked an inline comment as done.
donat.nagy 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]
----------------
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?


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