@@ -258,7 +258,8 @@ static void DiagnoseObjCImplementedDeprecations(Sema &S,
258
258
S.Diag (ND->getLocation (), diag::note_method_declared_at)
259
259
<< ND->getDeclName ();
260
260
else
261
- S.Diag (ND->getLocation (), diag::note_previous_decl) << " class" ;
261
+ S.Diag (ND->getLocation (), diag::note_previous_decl)
262
+ << (isa<ObjCCategoryDecl>(ND) ? " category" : " class" );
262
263
}
263
264
}
264
265
@@ -1724,7 +1725,8 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc,
1724
1725
Decl * const *ProtoRefs,
1725
1726
unsigned NumProtoRefs,
1726
1727
const SourceLocation *ProtoLocs,
1727
- SourceLocation EndProtoLoc) {
1728
+ SourceLocation EndProtoLoc,
1729
+ AttributeList *AttrList) {
1728
1730
ObjCCategoryDecl *CDecl;
1729
1731
ObjCInterfaceDecl *IDecl = getObjCInterfaceDecl (ClassName, ClassLoc, true );
1730
1732
@@ -1801,6 +1803,9 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc,
1801
1803
NumProtoRefs, Context);
1802
1804
}
1803
1805
1806
+ if (AttrList)
1807
+ ProcessDeclAttributeList (TUScope, CDecl, AttrList);
1808
+
1804
1809
CheckObjCDeclScope (CDecl);
1805
1810
return ActOnObjCContainerStartDefinition (CDecl);
1806
1811
}
@@ -1865,9 +1870,10 @@ Decl *Sema::ActOnStartCategoryImplementation(
1865
1870
CatIDecl->setImplementation (CDecl);
1866
1871
// Warn on implementating category of deprecated class under
1867
1872
// -Wdeprecated-implementations flag.
1868
- DiagnoseObjCImplementedDeprecations (*this ,
1869
- dyn_cast<NamedDecl>(IDecl),
1870
- CDecl->getLocation (), 2 );
1873
+ DiagnoseObjCImplementedDeprecations (
1874
+ *this ,
1875
+ CatIDecl->isDeprecated () ? CatIDecl : dyn_cast<NamedDecl>(IDecl),
1876
+ CDecl->getLocation (), 2 );
1871
1877
}
1872
1878
}
1873
1879
0 commit comments