r187958 - Split the deprecated increment bool warning into a sub-group of -Wdeprecated

Richard Trieu rtrieu at google.com
Wed Aug 7 20:05:52 PDT 2013


Author: rtrieu
Date: Wed Aug  7 22:05:52 2013
New Revision: 187958

URL: http://llvm.org/viewvc/llvm-project?rev=187958&view=rev
Log:
Split the deprecated increment bool warning into a sub-group of -Wdeprecated
so that it can be toggled independently of other deprecated warnings.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/SemaCXX/bool.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=187958&r1=187957&r2=187958&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Wed Aug  7 22:05:52 2013
@@ -58,11 +58,13 @@ def AbstractFinalClass : DiagGroup<"abst
 
 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">;
 

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=187958&r1=187957&r2=187958&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Aug  7 22:05:52 2013
@@ -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<Deprecated>;
+  "incrementing expression of type bool is deprecated">,
+  InGroup<DeprecatedIncrementBool>;
 def err_increment_decrement_enum : Error<
   "cannot %select{decrement|increment}0 expression of enum type %1">;
 def err_catch_incomplete_ptr : Error<

Modified: cfe/trunk/test/SemaCXX/bool.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/bool.cpp?rev=187958&r1=187957&r2=187958&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/bool.cpp (original)
+++ cfe/trunk/test/SemaCXX/bool.cpp Wed Aug  7 22:05:52 2013
@@ -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 {





More information about the cfe-commits mailing list