warn about categories that implement deprecated interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64670 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 76a5c2c..c378950 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -263,12 +263,7 @@
continue;
}
- if (PDecl->getAttr<UnavailableAttr>())
- Diag(ProtocolId[i].second, diag::warn_unavailable) <<
- PDecl->getDeclName();
- if (PDecl->getAttr<DeprecatedAttr>())
- Diag(ProtocolId[i].second, diag::warn_deprecated) <<
- PDecl->getDeclName();
+ DiagnoseUseOfDeprecatedDeclImpl(PDecl, ProtocolId[i].second);
// If this is a forward declaration and we are supposed to warn in this
// case, do it.
@@ -489,6 +484,9 @@
}
CDecl->setClassInterface(IDecl);
+
+ // If the interface is deprecated, warn about it.
+ DiagnoseUseOfDeprecatedDeclImpl(IDecl, ClassLoc);
/// Check for duplicate interface declaration for this category
ObjCCategoryDecl *CDeclChain;