[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
Fri Jul 6 10:18:38 PDT 2018


QF5690 added inline comments.


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


================
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}}
 
----------------
rjmccall wrote:
> Whoa, why is this test case using `-Weverything`?  That seems unnecessarily fragile.
Do you think it should be relaxed only to warnings that are appearing here?


Repository:
  rC Clang

https://reviews.llvm.org/D44539





More information about the cfe-commits mailing list