]> granicus.if.org Git - clang/commitdiff
Split the deprecated increment bool warning into a sub-group of -Wdeprecated
authorRichard Trieu <rtrieu@google.com>
Thu, 8 Aug 2013 03:05:52 +0000 (03:05 +0000)
committerRichard Trieu <rtrieu@google.com>
Thu, 8 Aug 2013 03:05:52 +0000 (03:05 +0000)
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

include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
test/SemaCXX/bool.cpp

index d3055748dde2aa918f2bd2f54a8da6e86f7cbd03..93cba3edd9b38da7c891151df298fcce8565f4b4 100644 (file)
@@ -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">;
 
index 20b2a40cb0893dd856fcb7ae46829023095e69c0..57425cb0803fc94a776545998e9e08629d95caa2 100644 (file)
@@ -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<
index f027186735b3e1248457a981a8bb5de247b1249c..69c0119357814e065953083cb30697c8bf558153 100644 (file)
@@ -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 {