diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-17 17:46:10 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-17 17:46:10 +0000 |
commit | 3985a324489dc4477b803bbb72f5d853a41324d3 (patch) | |
tree | c93cfc8e21edb60e317b066e530ae70e0b94ec45 /lib/Sema/SemaDeclObjC.cpp | |
parent | 52fa036b2ec930e88a23db731b194ef1e53114d6 (diff) |
Objective-C. Do not warn when an instance method and
class method with the same selctor but different argument
types having one of them in class extension.
// rdar://16312105
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 2bed6cac38..8f68852aaa 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/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); |