Fix <rdar://problem/6614945> method not found.

This was a fairly recent regression.

llvm-svn: 65547
This commit is contained in:
Steve Naroff 2009-02-26 18:16:19 +00:00
parent 58ac0b4bac
commit 42ab0dd1ee
2 changed files with 25 additions and 3 deletions

View File

@ -395,10 +395,10 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
}
if (Method && DiagnoseUseOfDecl(Method, receiverLoc))
return true;
} else {
// We're not in a method context, look for any factory method named 'Sel'.
Method = FactoryMethodPool[Sel].Method;
}
// Look for any factory method named 'Sel'.
if (!Method)
Method = FactoryMethodPool[Sel].Method;
if (!Method)
Method = LookupInstanceMethodInGlobalPool(
Sel, SourceRange(lbrac,rbrac));

View File

@ -2,7 +2,10 @@
typedef signed char BOOL;
@protocol NSObject
+ alloc;
- init;
- (BOOL) isEqual:(id) object;
- (Class)class;
@end
@interface NSObject < NSObject > {} @end
@ -38,3 +41,22 @@ extern NSString *const NSWillBecomeMultiThreadedNotification;
return[[self sharedInstance] run];
}
@end
@interface XX : NSObject
+ classMethod;
@end
@interface YY : NSObject
- whatever;
@end
@implementation YY
- whatever {
id obj = [[XX alloc] init];
[[obj class] classMethod];
}
@end