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

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 23 16:40:22 PDT 2018


erik.pilkington added a comment.

In https://reviews.llvm.org/D51189#1211754, @arphaman wrote:

> Hmm, I don't think this solution is ideal, we'd rather have an attribute somewhere for other consumers of availability annotations. Does MyObject have an implicit decl of `new`, or are we referring to `NSObject`s `new`? Ideally we would an attribute on a particular `new` instead, but that might not work.


We're referring to NSObject's new. I don't think it's unreasonable to ask users who override init to be unavailable also override new with the same annotation, but it seems like extra boilerplate for something that we can easily infer in clang. What other consumers are you concerned about?


Repository:
  rC Clang

https://reviews.llvm.org/D51189





More information about the cfe-commits mailing list