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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 9 19:23:50 PDT 2018


rjmccall added inline comments.


================
Comment at: lib/Sema/SemaObjCProperty.cpp:2554
+      PropertyTy->isObjCRetainableType() &&
+      !PropertyTy->isObjCClassType()) {
+    Diag(Loc, diag::warn_objc_property_assign_on_object);
----------------
Please use `isObjCARCImplicitlyUnretainedType` here.


================
Comment at: test/SemaObjC/property-in-class-extension-1.m:18
 
- at property (assign, readonly) NSString* changeMemoryModel; // expected-note {{property declared here}}
+ at property (unsafe_unretained, readonly) NSString* changeMemoryModel; // expected-note {{property declared here}}
 
----------------
Whoa, why is this test case using `-Weverything`?  That seems unnecessarily fragile.


Repository:
  rC Clang

https://reviews.llvm.org/D44539





More information about the cfe-commits mailing list