From: Richard Trieu Date: Thu, 8 Aug 2013 03:05:52 +0000 (+0000) Subject: Split the deprecated increment bool warning into a sub-group of -Wdeprecated X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f58443e4740539ef211f4da01be2160b2c91e1c3;p=clang Split the deprecated increment bool warning into a sub-group of -Wdeprecated so that it can be toggled independently of other deprecated warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187958 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index d3055748dd..93cba3edd9 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -58,11 +58,13 @@ def AbstractFinalClass : DiagGroup<"abstract-final-class">; def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">; def DeprecatedImplementations :DiagGroup<"deprecated-implementations">; +def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">; def DeprecatedRegister : DiagGroup<"deprecated-register">; def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings">; // FIXME: Why are DeprecatedImplementations and DeprecatedWritableStr // not in this group? def Deprecated : DiagGroup<"deprecated", [DeprecatedDeclarations, + DeprecatedIncrementBool, DeprecatedRegister]>, DiagCategory<"Deprecations">; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 20b2a40cb0..57425cb080 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -4881,7 +4881,8 @@ def note_member_declared_here : Note< "member %0 declared here">; def err_decrement_bool : Error<"cannot decrement expression of type bool">; def warn_increment_bool : Warning< - "incrementing expression of type bool is deprecated">, InGroup; + "incrementing expression of type bool is deprecated">, + InGroup; def err_increment_decrement_enum : Error< "cannot %select{decrement|increment}0 expression of enum type %1">; def err_catch_incomplete_ptr : Error< diff --git a/test/SemaCXX/bool.cpp b/test/SemaCXX/bool.cpp index f027186735..69c0119357 100644 --- a/test/SemaCXX/bool.cpp +++ b/test/SemaCXX/bool.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion \ +// RUN: -Wno-deprecated -Wdeprecated-increment-bool %s // Bool literals can be enum values. enum {