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

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 08:57:21 PDT 2019


Szelethus requested review of this revision.
Szelethus marked an inline comment as done.
Szelethus added a comment.

I changed the testfiles quite a bit, surprisingly, I'd appreciate another accept on this one please :) Seems to me that the changes describe the actual reports far better...



================
Comment at: test/clang-tidy/bugprone-branch-clone.cpp:348
+// CHECK-MESSAGES: :[[@LINE+1]]:5: warning: switch has 3 consecutive identical branches [bugprone-branch-clone]
+// CHECK-MESSAGES: :[[@LINE-6]]:24: note: expanded from macro 'CASE'
+    CASE(1)
----------------
...except the removal of these -- I guess
```
+        if (EndLoc.isMacroID())
+          EndLoc = Context.getSourceManager().getExpansionLoc(EndLoc);
```
is responsible for this, but I'm not really sure how else can I avoid the assertation failure.


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

https://reviews.llvm.org/D54757





More information about the cfe-commits mailing list