summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 4f87db426db..c86f735d57d 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -2737,8 +2737,11 @@ Decl *Sema::ActOnMethodDeclaration(
ObjCMethod->isInstanceMethod());
if (ObjCMethod->hasAttrs() &&
containsInvalidMethodImplAttribute(IMD, ObjCMethod->getAttrs())) {
- Diag(EndLoc, diag::warn_attribute_method_def);
- Diag(IMD->getLocation(), diag::note_method_declared_at);
+ SourceLocation MethodLoc = IMD->getLocation();
+ if (!getSourceManager().isInSystemHeader(MethodLoc)) {
+ Diag(EndLoc, diag::warn_attribute_method_def);
+ Diag(MethodLoc, diag::note_method_declared_at);
+ }
}
} else {
cast<DeclContext>(ClassDecl)->addDecl(ObjCMethod);
OpenPOWER on IntegriCloud