objc: put out more coherent warning when method definition
attributes don't match its declaration. // rdar://10529259.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145872 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 49fcfbf..afcf3cc 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -2712,8 +2712,10 @@
IMD = IDecl->lookupMethod(ObjCMethod->getSelector(),
ObjCMethod->isInstanceMethod());
if (ObjCMethod->hasAttrs() &&
- containsInvalidMethodImplAttribute(IMD, ObjCMethod->getAttrs()))
+ containsInvalidMethodImplAttribute(IMD, ObjCMethod->getAttrs())) {
Diag(EndLoc, diag::warn_attribute_method_def);
+ Diag(IMD->getLocation(), diag::note_method_declared_at);
+ }
} else {
cast<DeclContext>(ClassDecl)->addDecl(ObjCMethod);
}