erik.pilkington added a comment.

In https://reviews.llvm.org/D51189#1211910, @steven_wu wrote:

> I feel like this is a much tricky situation than just new and init. Following 
> example is the same situation.
>
>   __attribute__((objc_root_class))
>   @interface NSObject
>   - (void) foo;
>   - (void) bar;
>   @end
>  
>   @implementation NSObject
>   - (void) foo {}
>   - (void) bar { [self foo]; }
>   @end
>  
>   @interface MyObject : NSObject
>   - (void) foo __attribute__((unavailable));
>   @end
>  
>   void test(MyObject *obj) {
>     [obj bar];
>   }
>
>
> We can do something about [NSObject new] because we know it's implementation 
> but we have to live with more general cases.


I agree that the general case is impossible to properly diagnose, but I think 
its totally reasonable for us to special case this pattern with NSObject.



================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6951
+                                 std::string *Message,
+                                 ObjCInterfaceDecl *ClassMessageReceiver) {
   AvailabilityResult Result = D->getAvailability(Message);
----------------
arphaman wrote:
> Please be consistent with the name, you are using `ClassMessageReceiver`, 
> `ClassReceiver` and `Receiver` in different arguments in this patch.
Sure, sorry. I canonicalized on ClassReceiver.


https://reviews.llvm.org/D51189



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to