diff options
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 2bed6cac384..8f68852aaaf 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -838,7 +838,9 @@ void Sema::DiagnoseClassExtensionDupMethods(ObjCCategoryDecl *CAT, return; for (const auto *Method : CAT->methods()) { const ObjCMethodDecl *&PrevMethod = MethodMap[Method->getSelector()]; - if (PrevMethod && !MatchTwoMethodDeclarations(Method, PrevMethod)) { + if (PrevMethod && + (PrevMethod->isInstanceMethod() == Method->isInstanceMethod()) && + !MatchTwoMethodDeclarations(Method, PrevMethod)) { Diag(Method->getLocation(), diag::err_duplicate_method_decl) << Method->getDeclName(); Diag(PrevMethod->getLocation(), diag::note_previous_declaration); |