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

DonĂ¡t Nagy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 30 02:43:18 PST 2018


donat.nagy marked 8 inline comments as done.
donat.nagy added a comment.

At the end of the documentation I stated that the check examines the code after macro expansion. Is this note clear enough?



================
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]
----------------
Eugene.Zelenko wrote:
> 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.
I added support for ternary operators and documented this fact.


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