diff options
| author | Peter Szecsi <szepet95@gmail.com> | 2017-09-12 09:40:13 +0000 |
|---|---|---|
| committer | Peter Szecsi <szepet95@gmail.com> | 2017-09-12 09:40:13 +0000 |
| commit | 2087113f6c844c9a7101eff08091225be6532908 (patch) | |
| tree | 20c114297f166618b47779c66df8927890e12a97 /clang-tools-extra/test/clang-tidy/misc-suspicious-enum-usage.cpp | |
| parent | 38029d3c890747b019594eb4c43b4fb739bdc93e (diff) | |
| download | bcm5719-llvm-2087113f6c844c9a7101eff08091225be6532908.tar.gz bcm5719-llvm-2087113f6c844c9a7101eff08091225be6532908.zip | |
[clang-tidy] SuspiciousEnumUsageCheck bugfix
iThere is a reported bug on the checker not handling the some APSInt values
correctly: https://bugs.llvm.org/show_bug.cgi?id=34400
This patch aims to fix it.
Differential Revision: https://reviews.llvm.org/D37572
llvm-svn: 313016
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/misc-suspicious-enum-usage.cpp')
| -rw-r--r-- | clang-tools-extra/test/clang-tidy/misc-suspicious-enum-usage.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang-tools-extra/test/clang-tidy/misc-suspicious-enum-usage.cpp b/clang-tools-extra/test/clang-tidy/misc-suspicious-enum-usage.cpp index 27e78f5c73e..52d666dfcb8 100644 --- a/clang-tools-extra/test/clang-tidy/misc-suspicious-enum-usage.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-suspicious-enum-usage.cpp @@ -54,7 +54,7 @@ int trigger() { int emptytest = EmptyVal | B; if (bestDay() | A) return 1; - // CHECK-MESSAGES: :[[@LINE-2]]:17: warning: enum values are from different enum types + // CHECK-MESSAGES: :[[@LINE-2]]:17: warning: enum values are from different enum types if (I | Y) return 1; // CHECK-MESSAGES: :[[@LINE-2]]:9: warning: enum values are from different enum types @@ -88,3 +88,9 @@ int dont_trigger() { return 1; return 42; } + +namespace PR34400 { +enum { E1 = 0 }; +enum { E2 = -1 }; +enum { l = E1 | E2 }; +} |

