[cfe-commits] r71195 - in /cfe/branches/Apple/Dib: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclObjC.cpp test/SemaObjC/block-attr.m

Mike Stump mrs at apple.com
Thu May 7 16:47:03 PDT 2009


Author: mrs
Date: Thu May  7 18:47:01 2009
New Revision: 71195

URL: http://llvm.org/viewvc/llvm-project?rev=71195&view=rev
Log:
Merge in 71190:

Add a warning for a missing copy attribute on a property that is a
block pointer.  Radar 6441502

Added:
    cfe/branches/Apple/Dib/test/SemaObjC/block-attr.m
      - copied unchanged from r71190, cfe/trunk/test/SemaObjC/block-attr.m
Modified:
    cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp

Modified: cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td?rev=71195&r1=71194&r2=71195&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/Apple/Dib/include/clang/Basic/DiagnosticSemaKinds.td Thu May  7 18:47:01 2009
@@ -194,6 +194,9 @@
   "default property attribute 'assign' not appropriate for non-gc object">;
 def warn_property_attr_mismatch : Warning<
   "property attribute in continuation class does not match the primary class">;
+def warn_objc_property_copy_missing_on_block : Warning<
+    "'copy' attribute must be specified for the block property "
+    "when -fobjc-gc-only is specified">;
 def err_use_continuation_class : Error<
   "attribute of property in continuation class of %0 can only  be 'readwrite'">;
 def err_continuation_class : Error<"continuation class has no primary class">;

Modified: cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp?rev=71195&r1=71194&r2=71195&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/branches/Apple/Dib/lib/Sema/SemaDeclObjC.cpp Thu May  7 18:47:01 2009
@@ -1750,6 +1750,11 @@
     // <rdar://5168496&4855821&5607453&5096644&4947311&5698469&4947014&5168496>
     // (please trim this list while you are at it).
   }
+
+  if (!(Attributes & ObjCDeclSpec::DQ_PR_copy)
+      && getLangOptions().getGCMode() == LangOptions::GCOnly
+      && PropertyTy->isBlockPointerType())
+    Diag(Loc, diag::warn_objc_property_copy_missing_on_block);
 }
 
 Sema::DeclPtrTy Sema::ActOnProperty(Scope *S, SourceLocation AtLoc, 





More information about the cfe-commits mailing list