diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 91e7a185b053..aca1cc6e80fd 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -268,8 +268,12 @@ Sema::ExprResult Sema::ActOnClassMessage( if (!Method) Method = ClassDecl->lookupInstanceMethod(Sel); - if (Method && Method->getAttr()) - Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method) { + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_unavailable) << Method->getDeclName(); + } if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, true, lbrac, rbrac, returnType)) @@ -316,8 +320,12 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, Method = SuperDecl->lookupInstanceMethod(Sel); } - if (Method && Method->getAttr()) - Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method) { + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_unavailable) << Method->getDeclName(); + } if (CheckMessageArgumentTypes(ArgExprs, NumArgs, Sel, Method, false, lbrac, rbrac, returnType)) @@ -350,8 +358,12 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, ObjCImplementations[ClassDecl->getIdentifier()]) Method = ImpDecl->getClassMethod(Sel); - if (Method && Method->getAttr()) - Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method) { + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_unavailable) << Method->getDeclName(); + } } if (!Method) Method = FactoryMethodPool[Sel].Method; @@ -403,8 +415,12 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, Diag(lbrac, diag::warn_method_not_found_in_protocol) << Sel << SourceRange(lbrac, rbrac); - if (Method && Method->getAttr()) - Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method) { + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_deprecated) << Method->getDeclName(); + if (Method->getAttr()) + Diag(receiverLoc, diag::warn_unavailable) << Method->getDeclName(); + } } else { Diag(lbrac, diag::error_bad_receiver_type) << RExpr->getType() << RExpr->getSourceRange();