arphaman added a subscriber: ributzka. arphaman added a comment. In https://reviews.llvm.org/D51189#1211763, @erik.pilkington wrote:
> 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? + @ributzka One consumer is TAPI. It looks at the declarations present in the header file, so it won't be able to reason about the availability of `new` with the current implementation. We could potentially implicitly declare unavailable `new` in the interface if `init` is unavailable, but that wouldn't really too work with class categories (since `new` might be explicitly declared there). Maybe it's worth it though. Repository: rC Clang https://reviews.llvm.org/D51189 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits