[PATCH] D51189: [Sema][ObjC] Infer availability of +new from availability of -init

Steven Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 23 19:02:23 PDT 2018


steven_wu added a comment.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D51189





More information about the cfe-commits mailing list