[cfe-commits] r61953 - in /cfe/trunk: Driver/clang.cpp test/SemaObjC/property-10.m test/SemaObjC/property-12.m
Fariborz Jahanian
fjahanian at apple.com
Thu Jan 8 15:23:10 PST 2009
Author: fjahanian
Date: Thu Jan 8 17:23:10 2009
New Revision: 61953
URL: http://llvm.org/viewvc/llvm-project?rev=61953&view=rev
Log:
Place warning about 'readonly' property attributes which
are related to setter syntax under -Wreadonly-setter-attrs
to prevent warnings in projects built with gcc.
Modified:
cfe/trunk/Driver/clang.cpp
cfe/trunk/test/SemaObjC/property-10.m
cfe/trunk/test/SemaObjC/property-12.m
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=61953&r1=61952&r2=61953&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Thu Jan 8 17:23:10 2009
@@ -646,6 +646,10 @@
llvm::cl::desc("Warn about equality comparisons of floating point values"));
static llvm::cl::opt<bool>
+WarnPropertyReadonlyAttrs("Wreadonly-setter-attrs",
+ llvm::cl::desc("Warn about readonly properties with writable attributes"));
+
+static llvm::cl::opt<bool>
WarnNoFormatNonLiteral("Wno-format-nonliteral",
llvm::cl::desc("Do not warn about non-literal format strings"));
@@ -681,6 +685,10 @@
if (!WarnFloatEqual)
Diags.setDiagnosticMapping(diag::warn_floatingpoint_eq, diag::MAP_IGNORE);
+ if (!WarnPropertyReadonlyAttrs)
+ Diags.setDiagnosticMapping(diag::warn_objc_property_attr_mutually_exclusive,
+ diag::MAP_IGNORE);
+
// Silence "format string is not a string literal" warnings if requested
if (WarnNoFormatNonLiteral)
Diags.setDiagnosticMapping(diag::warn_printf_not_string_constant,
Modified: cfe/trunk/test/SemaObjC/property-10.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-10.m?rev=61953&r1=61952&r2=61953&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-10.m (original)
+++ cfe/trunk/test/SemaObjC/property-10.m Thu Jan 8 17:23:10 2009
@@ -1,4 +1,4 @@
-// RUN: clang -fsyntax-only -verify %s -fblocks
+// RUN: clang -fsyntax-only -Wreadonly-setter-attrs -verify %s -fblocks
// Check property attribute consistency.
Modified: cfe/trunk/test/SemaObjC/property-12.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-12.m?rev=61953&r1=61952&r2=61953&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-12.m (original)
+++ cfe/trunk/test/SemaObjC/property-12.m Thu Jan 8 17:23:10 2009
@@ -1,4 +1,4 @@
-// RUN: clang -fsyntax-only -verify %s
+// RUN: clang -fsyntax-only -Wreadonly-setter-attrs -verify %s
@protocol P0
@property(readonly,assign) id X; // expected-warning {{property attributes 'readonly' and 'assign' are mutually exclusive}}
More information about the cfe-commits
mailing list