1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -verify %s 2*67e74705SXin Li 3*67e74705SXin Li@interface MyBase 4*67e74705SXin Li- (void) rootInstanceMethod; 5*67e74705SXin Li@end 6*67e74705SXin Li 7*67e74705SXin Li@interface MyIntermediate: MyBase 8*67e74705SXin Li@end 9*67e74705SXin Li 10*67e74705SXin Li@interface MyDerived: MyIntermediate 11*67e74705SXin Li- (void) instanceMethod; 12*67e74705SXin Li+ (void) classMethod; 13*67e74705SXin Li@end 14*67e74705SXin Li 15*67e74705SXin Li@implementation MyDerived 16*67e74705SXin Li- (void) instanceMethod { 17*67e74705SXin Li} 18*67e74705SXin Li 19*67e74705SXin Li+ (void) classMethod { /* If a class method is not found, the root */ 20*67e74705SXin Li [self rootInstanceMethod]; /* class is searched for an instance method */ 21*67e74705SXin Li [MyIntermediate rootInstanceMethod]; /* with the same name. */ 22*67e74705SXin Li 23*67e74705SXin Li [self instanceMethod];// expected-warning {{'+instanceMethod' not found (return type defaults to 'id')}} 24*67e74705SXin Li [MyDerived instanceMethod];// expected-warning {{'+instanceMethod' not found (return type defaults to 'id')}} 25*67e74705SXin Li} 26*67e74705SXin Li@end 27*67e74705SXin Li 28*67e74705SXin Li@interface Object @end 29*67e74705SXin Li 30*67e74705SXin Li@interface Class1 31*67e74705SXin Li- (void)setWindow:(Object *)wdw; 32*67e74705SXin Li@end 33*67e74705SXin Li 34*67e74705SXin Li@interface Class2 35*67e74705SXin Li- (void)setWindow:(Class1 *)window; 36*67e74705SXin Li@end 37*67e74705SXin Li 38*67e74705SXin Li#define nil (void*)0 39*67e74705SXin Li 40*67e74705SXin Liid foo(void) { 41*67e74705SXin Li Object *obj; 42*67e74705SXin Li id obj2 = obj; 43*67e74705SXin Li [obj setWindow:nil]; // expected-warning {{'Object' may not respond to 'setWindow:'}} 44*67e74705SXin Li 45*67e74705SXin Li return obj; 46*67e74705SXin Li} 47