[PATCH] D44539: [Sema][Objective-C] Add check to warn when property of objc type has assign attribute

Alfred Zien via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 21 07:25:12 PDT 2018


QF5690 added inline comments.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1018
+def warn_objc_property_assign_on_object : Warning<
+  "'assign' attribute must not be of object type, use 'unsafe_unretained' instead">,
+  InGroup<ObjCPropertyAssignOnObjectType>, DefaultIgnore;
----------------
rjmccall wrote:
> "must" is rather strong for a warning.  Maybe something more like "'assign' attribute on property of object type could be 'unsafe_unretained'"?
But "could be" is rather weak :) 
May be "Prefer using explicit 'unsafe_unretained' attribute instead of 'assign' for object types", or "Using explicit 'unsafe_unretained' attribute instead of 'assign' for object types is preferred" (if passive voice is preferred)


Repository:
  rC Clang

https://reviews.llvm.org/D44539





More information about the cfe-commits mailing list