aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-10-12 18:49:25 +0000
committerSteve Naroff <snaroff@apple.com>2007-10-12 18:49:25 +0000
commit8f744764137f3c47b2e1fde84447e9c90720b900 (patch)
treef5820502437d8165aa58bb3dbd034d4858535685
parent6eda8c9cefb498ac8403bc65854e6ce411a07855 (diff)
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
-rw-r--r--Sema/SemaDecl.cpp8
-rw-r--r--clang.xcodeproj/project.pbxproj1
-rw-r--r--test/Sema/check-dup-decl-methods-1.m6
3 files changed, 11 insertions, 4 deletions
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<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 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
+