[cfe-commits] r61202 - in /cfe/trunk: lib/AST/DeclObjC.cpp test/SemaObjC/protocol-lookup.m
Steve Naroff
snaroff at apple.com
Thu Dec 18 07:50:50 PST 2008
Author: snaroff
Date: Thu Dec 18 09:50:41 2008
New Revision: 61202
URL: http://llvm.org/viewvc/llvm-project?rev=61202&view=rev
Log:
Fix http://llvm.org/bugs/show_bug.cgi?id=3189.
Added:
cfe/trunk/test/SemaObjC/protocol-lookup.m
Modified:
cfe/trunk/lib/AST/DeclObjC.cpp
Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=61202&r1=61201&r2=61202&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Thu Dec 18 09:50:41 2008
@@ -858,7 +858,7 @@
return MethodDecl;
for (protocol_iterator I = protocol_begin(), E = protocol_end(); I != E; ++I)
- if ((MethodDecl = (*I)->getInstanceMethod(Sel)))
+ if ((MethodDecl = (*I)->lookupInstanceMethod(Sel)))
return MethodDecl;
return NULL;
}
@@ -872,7 +872,7 @@
return MethodDecl;
for (protocol_iterator I = protocol_begin(), E = protocol_end(); I != E; ++I)
- if ((MethodDecl = (*I)->getClassMethod(Sel)))
+ if ((MethodDecl = (*I)->lookupClassMethod(Sel)))
return MethodDecl;
return NULL;
}
Added: cfe/trunk/test/SemaObjC/protocol-lookup.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-lookup.m?rev=61202&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/protocol-lookup.m (added)
+++ cfe/trunk/test/SemaObjC/protocol-lookup.m Thu Dec 18 09:50:41 2008
@@ -0,0 +1,50 @@
+// RUN: clang -fsyntax-only -verify %s
+ at protocol NSObject
+- retain;
+- release;
+ at end
+
+ at interface NSObject
+- init;
+- dealloc;
+ at end
+
+ at protocol Foo <NSObject>
+ at end
+
+ at protocol Bar <Foo>
+ at end
+
+ at interface Baz : NSObject {
+ id <Foo> _foo;
+ id <Bar> _bar;
+}
+- (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar;
+ at end
+
+ at implementation Baz
+
+- (id)init
+{
+ return [self initWithFoo:0 bar:0];
+}
+
+- (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar
+{
+ self = [super init];
+ if (self != 0) {
+ _foo = [foo retain];
+ _bar = [bar retain];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [_foo release];
+ [_bar release];
+ [super dealloc];
+}
+
+ at end
+
More information about the cfe-commits
mailing list