Place warning about 'readonly' property attributes which
are related to setter syntax under -Wreadonly-setter-attrs
to prevent warnings in projects built with gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61953 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 1b29671..77fb3c8 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -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,