arphaman added a comment. That's probably the best solution then, I don't think declaring implicit `new` just for availability attribute is sound.
Does this work with `self new` as well? ================ Comment at: clang/lib/AST/DeclObjC.cpp:833 +bool ObjCMethodDecl::definedInNSObject(const ASTContext &Ctx) const { + if (const ObjCProtocolDecl *PD = + dyn_cast<const ObjCProtocolDecl>(getDeclContext())) ---------------- `const auto` ================ Comment at: clang/lib/AST/DeclObjC.cpp:836 + return PD->getIdentifier() == Ctx.getNSObjectName(); + if (const ObjCInterfaceDecl *ID = + dyn_cast<const ObjCInterfaceDecl>(getDeclContext())) { ---------------- `const auto` ================ Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6951 + std::string *Message, + ObjCInterfaceDecl *ClassMessageReceiver) { AvailabilityResult Result = D->getAvailability(Message); ---------------- Please be consistent with the name, you are using `ClassMessageReceiver`, `ClassReceiver` and `Receiver` in different arguments in this patch. ================ Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6986 + if (const auto *MD = dyn_cast<ObjCMethodDecl>(D)) { + if (S.NSAPIObj != nullptr && ClassMessageReceiver != nullptr) { + ObjCMethodDecl *Init = ClassMessageReceiver->lookupInstanceMethod( ---------------- Comparisons to `nullptr` are redundant, you can just say `S.NSAPIObj && ClassMessageReceiver`. Same below. 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