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

2018-09-05 Thread John McCall via Phabricator via cfe-commits
rjmccall closed this revision. rjmccall added a comment. Committed as r341489. Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-08-22 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 added a comment. In https://reviews.llvm.org/D44539#1208838, @rjmccall wrote: > Please read the developer policy: https://llvm.org/docs/DeveloperPolicy.html > > The information is on that page. > We grant commit access to contributors with a track record of submitting high > quality

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

2018-08-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Please read the developer policy: https://llvm.org/docs/DeveloperPolicy.html The information is on that page. Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-08-22 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 added a comment. > you can ask for commit privileges yourself. Ok, how do I do it? Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-08-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D44539#1208780, @QF5690 wrote: > In https://reviews.llvm.org/D44539#1207982, @rjmccall wrote: > > > LGTM. > > > Thanks! What I should do next? Haven't found any info in docs about it :) https://llvm.org/docs/Contributing.html It's up to

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

2018-08-22 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 added a comment. In https://reviews.llvm.org/D44539#1207982, @rjmccall wrote: > LGTM. Thanks! What I should do next? Haven't found any info in docs about it :) Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits

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

2018-08-21 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM. Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-08-21 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 updated this revision to Diff 161684. QF5690 added a comment. Using `isObjCARCImplicitlyUnretainedType` instead of `isObjCClassType` Tests in `property-in-class-extension-1.m` relaxed to `-Wproperty-attribute-mismatch` (was `-Weverything`) Repository: rC Clang

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

2018-08-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Herald added a subscriber: jfb. Hey, still working on this? Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-07-08 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: test/SemaObjC/property-in-class-extension-1.m:18 -@property (assign, readonly) NSString* changeMemoryModel; // expected-note {{property declared here}} +@property (unsafe_unretained, readonly) NSString* changeMemoryModel; //

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

2018-07-06 Thread Alfred Zien via Phabricator via cfe-commits
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

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

2018-06-09 Thread John McCall via Phabricator via cfe-commits
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

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

2018-06-08 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 updated this revision to Diff 150487. QF5690 added a comment. Remove warning for `Class` type, change warning message. Repository: rC Clang https://reviews.llvm.org/D44539 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basic/DiagnosticSemaKinds.td

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

2018-05-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D44539#1106802, @rjmccall wrote: > In https://reviews.llvm.org/D44539#1106443, @aaron.ballman wrote: > > > In https://reviews.llvm.org/D44539#1106152, @rjmccall wrote: > > > > > This was approved by the Objective-C language group as a

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

2018-05-21 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In https://reviews.llvm.org/D44539#1106443, @aaron.ballman wrote: > In https://reviews.llvm.org/D44539#1106152, @rjmccall wrote: > > > This was approved by the Objective-C language group as a default-off > > warning. > > > We usually do not expose new default-off

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

2018-05-21 Thread Alfred Zien via Phabricator via cfe-commits
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, DefaultIgnore;

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

2018-05-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D44539#1106152, @rjmccall wrote: > This was approved by the Objective-C language group as a default-off warning. We usually do not expose new default-off warnings because experience shows that they rarely ever get enabled by users. If

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

2018-05-21 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. This was approved by the Objective-C language group as a default-off warning. 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

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

2018-05-18 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. This isn't really an Objective-C user forum, but I'll try to summarize briefly. `unsafe_unretained` is an unsafe version of `weak` — it's unsafe because it can be left dangling if the object is deallocated. It's necessary for a small (and getting smaller every year)

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

2018-05-18 Thread Yan Zhang via Phabricator via cfe-commits
Wizard added a comment. Is there any case for property of ObjC types that we should use `unsafe_unretained` or `assign` rather than `weak`? In my understanding, `weak` is for properties of ObjC types as the replacement of `unsafe_unretained` and `assign` is for properties of primitive types.

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

2018-05-18 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. It's waiting on a discussion that's happening pretty slowly, sorry. I know this is frustrating. Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-05-18 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 added a comment. It's been a couple of months now, @rjmccall any ETA's? Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-03-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. We added the `unsafe_unretained` property attribute as part of ARC because we were introducing `__unsafe_retained` as a type qualifier and we wanted all the type qualifiers to have corresponding attribute spellings. `assign` is the much-older attribute, and its

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. > Isn't it better to have unsafe_unretained there? That is a good question for the author of that property attribute. I'm not sure of the entire history. Repository: rC Clang https://reviews.llvm.org/D44539 ___

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

2018-03-20 Thread Alfred Zien via Phabricator via cfe-commits
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

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

2018-03-20 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. I think the problem is there are valid places to use assign on object types (especially delegates). There are a lot of special cases to deal with here, and it's really up to each team to decide the rules for when assign on object types are OK, so I don't think a

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

2018-03-20 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 added a comment. In https://reviews.llvm.org/D44539#1041993, @benhamilton wrote: > I wonder if this wouldn't be better as a clang-tidy check: > > https://github.com/llvm-mirror/clang-tools-extra/tree/master/clang-tidy/objc Border between clang-tidy checks and compiler diagnostics is not

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

2018-03-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman edited reviewers, added: rjmccall; removed: aaron.ballman. aaron.ballman added a subscriber: rjmccall. aaron.ballman added a comment. I don't know enough about ObjC to feel comfortable reviewing this, but I've added @rjmccall who may have opinions. Repository: rC Clang

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

2018-03-19 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. I wonder if this wouldn't be better as a clang-tidy check: https://github.com/llvm-mirror/clang-tools-extra/tree/master/clang-tidy/objc Repository: rC Clang https://reviews.llvm.org/D44539 ___ cfe-commits mailing

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

2018-03-19 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 added reviewers: aaron.ballman, benhamilton. QF5690 added a comment. Hey, saw many revisions around obj-c and sema that you are reviewing. Can you help me with this one? Repository: rC Clang https://reviews.llvm.org/D44539 ___

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

2018-03-15 Thread Alfred Zien via Phabricator via cfe-commits
QF5690 created this revision. QF5690 added a reviewer: rsmith. QF5690 added a project: clang. Herald added a subscriber: cfe-commits. There is a problem, that `assign` attribute very often getting out of attention. For example, consider this code: @property(nonatomic, strong, readonly,