[cfe-commits] r122967 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td test/SemaCXX/writable-strings-deprecated.cpp

Fariborz Jahanian fjahanian at apple.com
Thu Jan 6 10:45:19 PST 2011


Author: fjahanian
Date: Thu Jan  6 12:45:19 2011
New Revision: 122967

URL: http://llvm.org/viewvc/llvm-project?rev=122967&view=rev
Log:
Put warning about makeing a string writable into
its own deprecated diagnostics group so it can be
turned off selectively. // rdar://8827606

Added:
    cfe/trunk/test/SemaCXX/writable-strings-deprecated.cpp
Modified:
    cfe/trunk/include/clang/Basic/DiagnosticGroups.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td

Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=122967&r1=122966&r2=122967&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Thu Jan  6 12:45:19 2011
@@ -35,6 +35,7 @@
 def GNUDesignator : DiagGroup<"gnu-designator">;
 
 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
+def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings">;
 def Deprecated : DiagGroup<"deprecated", [ DeprecatedDeclarations] >,
                  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=122967&r1=122966&r2=122967&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Jan  6 12:45:19 2011
@@ -2340,7 +2340,7 @@
   "array initializer must be an initializer "
   "list%select{| or string literal}0">;
 def warn_deprecated_string_literal_conversion : Warning<
-  "conversion from string literal to %0 is deprecated">, InGroup<Deprecated>;
+  "conversion from string literal to %0 is deprecated">, InGroup<DeprecatedWritableStr>;
 def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
 def err_typecheck_sclass_fscope : Error<
   "illegal storage class on file-scoped variable">;

Added: cfe/trunk/test/SemaCXX/writable-strings-deprecated.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/writable-strings-deprecated.cpp?rev=122967&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/writable-strings-deprecated.cpp (added)
+++ cfe/trunk/test/SemaCXX/writable-strings-deprecated.cpp Thu Jan  6 12:45:19 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-writable-strings -verify %s
+// rdar://8827606
+
+char *fun(void)
+{
+   return "foo";
+}
+
+void test(bool b)
+{
+  ++b; // expected-warning {{incrementing expression of type bool is deprecated}}
+}





More information about the cfe-commits mailing list