forked from OSchip/llvm-project
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:
parent
91c052c4d8
commit
13d08955ea
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue