Method attributes may only be specified on method
declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71597 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 76e73fc..d854f0b 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1671,6 +1671,8 @@
PrevMethod = ImpDecl->getClassMethod(Context, Sel);
ImpDecl->addClassMethod(Context, ObjCMethod);
}
+ if (AttrList)
+ Diag(EndLoc, diag::warn_attribute_method_def);
}
else if (ObjCCategoryImplDecl *CatImpDecl =
dyn_cast<ObjCCategoryImplDecl>(ClassDecl)) {
@@ -1681,6 +1683,8 @@
PrevMethod = CatImpDecl->getClassMethod(Context, Sel);
CatImpDecl->addClassMethod(Context, ObjCMethod);
}
+ if (AttrList)
+ Diag(EndLoc, diag::warn_attribute_method_def);
}
if (PrevMethod) {
// You can never have two method definitions with the same name.