Skip to content

Commit

Permalink
[Diagnostics] Make -Wenum-compare-conditional off by default
Browse files Browse the repository at this point in the history
Too many false positives, eg. in Chromium.

llvm-svn: 373371
  • Loading branch information
davidbolvansky committed Oct 1, 2019
1 parent dca5b94 commit 00d632e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticGroups.td
Expand Up @@ -565,7 +565,7 @@ def SwitchEnum : DiagGroup<"switch-enum">;
def Switch : DiagGroup<"switch">;
def EnumCompareConditional : DiagGroup<"enum-compare-conditional">;
def EnumCompareSwitch : DiagGroup<"enum-compare-switch">;
def EnumCompare : DiagGroup<"enum-compare", [EnumCompareConditional, EnumCompareSwitch]>;
def EnumCompare : DiagGroup<"enum-compare", [EnumCompareSwitch]>;
def ImplicitFallthroughPerFunction :
DiagGroup<"implicit-fallthrough-per-function">;
def ImplicitFallthrough : DiagGroup<"implicit-fallthrough",
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Expand Up @@ -6172,7 +6172,7 @@ def warn_comparison_of_mixed_enum_types : Warning<
def warn_conditional_mixed_enum_types : Warning<
"enumeration type mismatch in conditional expression"
"%diff{ ($ and $)|}0,1">,
InGroup<EnumCompareConditional>;
InGroup<EnumCompareConditional>, DefaultIgnore;
def warn_comparison_of_mixed_enum_types_switch : Warning<
"comparison of two values with different enumeration types in switch statement"
"%diff{ ($ and $)|}0,1">,
Expand Down
4 changes: 0 additions & 4 deletions clang/test/Sema/warn-conditional-emum-types-mismatch.c
@@ -1,9 +1,5 @@
// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wenum-compare-conditional %s
// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wenum-compare %s
// RUN: %clang_cc1 -x c -fsyntax-only -verify %s
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wenum-compare-conditional %s
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wenum-compare %s
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s

enum ro { A = 0x10 };
enum rw { B = 0xFF };
Expand Down

0 comments on commit 00d632e

Please sign in to comment.