diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-22 19:05:31 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-22 19:05:31 +0000 |
commit | 804058ece0d8f692faac8518ce4d98975ba57ac2 (patch) | |
tree | b9ce0ec36088b8ce9033609a6c71f0ae35831eff /lib/Sema/SemaDeclObjC.cpp | |
parent | cfb664c308fcfe5bf17d2fe430bcedf1f3707a28 (diff) |
Patch to remove bogus warning in case of @dynamic
property in a category and to issue diagnostics
for mismatch method in some other cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 7759bac681..3f86e52e64 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -737,13 +737,16 @@ void Sema::ImplMethodsVsClassMethods(ObjCImplementationDecl* IMPDecl, E = IDecl->instmeth_end(); I != E; ++I) if (!(*I)->isSynthesized() && !InsMap.count((*I)->getSelector())) WarnUndefinedMethod(IMPDecl->getLocation(), *I, IncompleteImpl); - else if (!(*I)->isSynthesized()){ + else { ObjCMethodDecl *ImpMethodDecl = IMPDecl->getInstanceMethod((*I)->getSelector()); ObjCMethodDecl *IntfMethodDecl = IDecl->getInstanceMethod((*I)->getSelector()); - WarnConflictingTypedMethods(ImpMethodDecl, IntfMethodDecl); - + assert(IntfMethodDecl && + "IntfMethodDecl is null in ImplMethodsVsClassMethods"); + // ImpMethodDecl may be null as in a @dynamic property. + if (ImpMethodDecl) + WarnConflictingTypedMethods(ImpMethodDecl, IntfMethodDecl); } llvm::DenseSet<Selector> ClsMap; @@ -790,14 +793,18 @@ void Sema::ImplCategoryMethodsVsIntfMethods(ObjCCategoryImplDecl *CatImplDecl, bool IncompleteImpl = false; for (ObjCCategoryDecl::instmeth_iterator I = CatClassDecl->instmeth_begin(), E = CatClassDecl->instmeth_end(); I != E; ++I) - if (!InsMap.count((*I)->getSelector())) + if (!(*I)->isSynthesized() && !InsMap.count((*I)->getSelector())) WarnUndefinedMethod(CatImplDecl->getLocation(), *I, IncompleteImpl); else { ObjCMethodDecl *ImpMethodDecl = CatImplDecl->getInstanceMethod((*I)->getSelector()); ObjCMethodDecl *IntfMethodDecl = CatClassDecl->getInstanceMethod((*I)->getSelector()); - WarnConflictingTypedMethods(ImpMethodDecl, IntfMethodDecl); + assert(IntfMethodDecl && + "IntfMethodDecl is null in ImplCategoryMethodsVsIntfMethods"); + // ImpMethodDecl may be null as in a @dynamic property. + if (ImpMethodDecl) + WarnConflictingTypedMethods(ImpMethodDecl, IntfMethodDecl); } llvm::DenseSet<Selector> ClsMap; |