diff options
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 10 | ||||
| -rw-r--r-- | clang/test/SemaObjC/attr-deprecated.m | 11 | 
2 files changed, 15 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 76a5c2c42a3..c3789508e14 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -263,12 +263,7 @@ Sema::FindProtocolDeclaration(bool WarnOnDeclarations,        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 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc,    }    CDecl->setClassInterface(IDecl); +   +  // If the interface is deprecated, warn about it. +  DiagnoseUseOfDeprecatedDeclImpl(IDecl, ClassLoc);    /// Check for duplicate interface declaration for this category    ObjCCategoryDecl *CDeclChain; diff --git a/clang/test/SemaObjC/attr-deprecated.m b/clang/test/SemaObjC/attr-deprecated.m index fa91334a0a6..29789ac2650 100644 --- a/clang/test/SemaObjC/attr-deprecated.m +++ b/clang/test/SemaObjC/attr-deprecated.m @@ -81,3 +81,14 @@ int t5() {    return f.FooBar; // expected-warning {{warning: 'FooBar' is deprecated}}  } + +__attribute ((deprecated))   +@interface DEPRECATED { +  @public int ivar;  +}  +- (int) instancemethod; +@property  int prop;  +@end + +@interface DEPRECATED (Category) // expected-warning {{warning: 'DEPRECATED' is deprecated}} +@end  | 

