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 7e0a51f..002578b 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -1737,11 +1737,13 @@
 void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl,
                                      DeclTy **allMethods, unsigned allNum) {
   Decl *ClassDecl = static_cast<Decl *>(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<ObjcMethodDecl*, 32> insMethods;
   llvm::SmallVector<ObjcMethodDecl*, 16> clsMethods;
   
diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj
index 75d9388..b88c381 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 1012900..d69c4a7 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
+