[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
Tue Mar 20 13:30:20 PDT 2018


QF5690 added a comment.

> I think the problem is there are valid places to use assign on object types (especially delegates).

Isn't it better to have unsafe_unretained there? I thought unsafe_unretained keyword is introduced specifically for that kinds of things.

Ok, here is my last point :) Attributes like `strong`, `retain`, `copy` is commonly reffered as "ownership attribute". But `assign` does not tells anything about ownership, and from that point of view, it is semantically wrong to have `assign` on object types, and having `unsafe_unretained` that actually tells something about ownership – correct. If that's not the case, I can't understand the reason why `unsafe_unreatined` even exists.


Repository:
  rC Clang

https://reviews.llvm.org/D44539





More information about the cfe-commits mailing list