objc QOI: Don't't warn about mismatch between attributes

on method declaration and definition if former is in
a system header. // rdar://10580333

llvm-svn: 147020
This commit is contained in:
Fariborz Jahanian 2011-12-21 00:09:11 +00:00
parent 91c052c4d8
commit 13d08955ea
1 changed files with 5 additions and 2 deletions

View File

@ -2737,8 +2737,11 @@ Decl *Sema::ActOnMethodDeclaration(
ObjCMethod->isInstanceMethod()); ObjCMethod->isInstanceMethod());
if (ObjCMethod->hasAttrs() && if (ObjCMethod->hasAttrs() &&
containsInvalidMethodImplAttribute(IMD, ObjCMethod->getAttrs())) { containsInvalidMethodImplAttribute(IMD, ObjCMethod->getAttrs())) {
Diag(EndLoc, diag::warn_attribute_method_def); SourceLocation MethodLoc = IMD->getLocation();
Diag(IMD->getLocation(), diag::note_method_declared_at); if (!getSourceManager().isInSystemHeader(MethodLoc)) {
Diag(EndLoc, diag::warn_attribute_method_def);
Diag(MethodLoc, diag::note_method_declared_at);
}
} }
} else { } else {
cast<DeclContext>(ClassDecl)->addDecl(ObjCMethod); cast<DeclContext>(ClassDecl)->addDecl(ObjCMethod);