From d89aefb740d1de881d4886e783daa5bb2ba56e90 Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Tue, 1 Oct 2019 18:12:13 +0000 Subject: [PATCH] [Diagnostics] Make -Wenum-compare-conditional off by default Too many false positives, eg. in Chromium. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373371 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticGroups.td | 2 +- include/clang/Basic/DiagnosticSemaKinds.td | 2 +- test/Sema/warn-conditional-emum-types-mismatch.c | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 16de6a2d07..9e9b7a36f7 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -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", diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index dffaf5592f..2ccd3090a4 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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; + InGroup, 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">, diff --git a/test/Sema/warn-conditional-emum-types-mismatch.c b/test/Sema/warn-conditional-emum-types-mismatch.c index ec7f1b37ff..12264ff892 100644 --- a/test/Sema/warn-conditional-emum-types-mismatch.c +++ b/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 }; -- 2.40.0