"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">;
// <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,
--- /dev/null
+// RUN: clang-cc -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks -fobjc-gc-only %s
+
+@interface Thing {}
+
+@property void(^someBlock)(void); // expected-warning {{'copy' attribute must be specified for the block property}}
+@property(copy) void(^OK)(void);
+
+
+@end