From: Steve Naroff Date: Fri, 12 Oct 2007 18:49:25 +0000 (+0000) Subject: Replace one FIXME with another. We handle protocols just fine now. The ObjC decl... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f744764137f3c47b2e1fde84447e9c90720b900;p=clang Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42923 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 7e0a51f5c5..002578bbc2 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1737,11 +1737,13 @@ bool Sema:: MatchTwoMethodDeclarations(const ObjcMethodDecl *Method, void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl, DeclTy **allMethods, unsigned allNum) { Decl *ClassDecl = static_cast(classDecl); - - // FIXME: Fix this when we can handle methods declared in protocols. - // See Parser::ParseObjCAtProtocolDeclaration + + // FIXME: If we don't have a ClassDecl, we have an error. I (snaroff) would + // prefer we always pass in a decl. If the decl has an error, isInvalidDecl() + // should be true. if (!ClassDecl) return; + llvm::SmallVector insMethods; llvm::SmallVector clsMethods; diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index 75d938806b..b88c381faa 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -742,7 +742,6 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; - compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* clang */; projectDirPath = ""; diff --git a/test/Sema/check-dup-decl-methods-1.m b/test/Sema/check-dup-decl-methods-1.m index 1012900e99..d69c4a7100 100644 --- a/test/Sema/check-dup-decl-methods-1.m +++ b/test/Sema/check-dup-decl-methods-1.m @@ -30,3 +30,9 @@ + (T**) meth1; // expected-error {{duplicate declaration of method 'meth1'}} + (int) foobar; @end + +@protocol P +- (int) meth; +- (int*) meth; +@end +