r184068 - Add warning group -Wdeprecated-register for C++11 warning on 'register' being

Richard Smith richard-llvm at metafoo.co.uk
Sun Jun 16 17:01:58 PDT 2013


Author: rsmith
Date: Sun Jun 16 19:01:58 2013
New Revision: 184068

URL: http://llvm.org/viewvc/llvm-project?rev=184068&view=rev
Log:
Add warning group -Wdeprecated-register for C++11 warning on 'register' being
deprecated.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/test/SemaCXX/deprecated.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=184068&r1=184067&r2=184068&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Sun Jun 16 19:01:58 2013
@@ -57,12 +57,15 @@ def DeleteNonVirtualDtor : DiagGroup<"de
 def AbstractFinalClass : DiagGroup<"abstract-final-class">;
 
 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
+def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
+def DeprecatedRegister : DiagGroup<"deprecated-register">;
 def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings">;
-def Deprecated : DiagGroup<"deprecated", [ DeprecatedDeclarations] >,
+// FIXME: Why are DeprecatedImplementations and DeprecatedWritableStr
+// not in this group?
+def Deprecated : DiagGroup<"deprecated", [DeprecatedDeclarations,
+                                          DeprecatedRegister]>,
                  DiagCategory<"Deprecations">;
 
-def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
-
 def : DiagGroup<"disabled-optimization">;
 def : DiagGroup<"discard-qual">;
 def : DiagGroup<"div-by-zero">;

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=184068&r1=184067&r2=184068&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Sun Jun 16 19:01:58 2013
@@ -310,7 +310,8 @@ def err_expected_class_name_not_template
 def err_unspecified_vla_size_with_static : Error<
   "'static' may not be used with an unspecified variable length array size">;
 def warn_deprecated_register : Warning<
-  "'register' storage class specifier is deprecated">, InGroup<Deprecated>;
+  "'register' storage class specifier is deprecated">,
+  InGroup<DeprecatedRegister>;
 
 def err_expected_case_before_expression: Error<
   "expected 'case' keyword before expression">;

Modified: cfe/trunk/test/SemaCXX/deprecated.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/deprecated.cpp?rev=184068&r1=184067&r2=184068&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/deprecated.cpp (original)
+++ cfe/trunk/test/SemaCXX/deprecated.cpp Sun Jun 16 19:01:58 2013
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify
 // RUN: %clang_cc1 -std=c++1y %s -Wdeprecated -verify
 
+// RUN: %clang_cc1 -std=c++1y %s -Wdeprecated -verify -Wno-deprecated-register -DNO_DEPRECATED_FLAGS
+
 #include "Inputs/register.h"
 
 void f() throw();
@@ -15,7 +17,7 @@ void h() throw(...);
 
 void stuff() {
   register int n;
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201103L && !defined(NO_DEPRECATED_FLAGS)
   // expected-warning at -2 {{'register' storage class specifier is deprecated}}
 #endif
 





More information about the cfe-commits mailing list