Skip to content

Commit

Permalink
[clang-tidy][NFC] Fix bugprone-suspicious-enum-usage tests
Browse files Browse the repository at this point in the history
Fixes failure in tests from a bugprone-suspicious-enum-usage check
by limiting those test to C++17 only to make CI green.
Tests were broken by change introduced in pull request llvm#73105
  • Loading branch information
PiotrZSL committed Nov 29, 2023
1 parent fae233c commit fc19424
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: {bugprone-suspicious-enum-usage.StrictMode: true}}" --
// RUN: %check_clang_tidy -std=c++17 %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: {bugprone-suspicious-enum-usage.StrictMode: true}}" --

enum A {
A = 1,
Expand Down Expand Up @@ -71,7 +71,7 @@ int trigger() {
unsigned p = R;
PP pp = Q;
p |= pp;

enum X x = Z;
p = x | Z;
return 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: {bugprone-suspicious-enum-usage.StrictMode: false}}" --
// RUN: %check_clang_tidy -std=c++17 %s bugprone-suspicious-enum-usage %t -- -config="{CheckOptions: {bugprone-suspicious-enum-usage.StrictMode: false}}"

enum Empty {
};
Expand Down Expand Up @@ -79,7 +79,7 @@ int dont_trigger() {
int d = c | H, e = b * a;
a = B | C;
b = X | Z;

if (Tuesday != Monday + 1 ||
Friday - Thursday != 1 ||
Sunday + Wednesday == (Sunday | Wednesday))
Expand Down

0 comments on commit fc19424

Please sign in to comment.