brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 8c8c216 Raw
47 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3@interface MyBase 4- (void) rootInstanceMethod;5@end6 7@interface MyIntermediate: MyBase8@end9 10@interface MyDerived: MyIntermediate11- (void) instanceMethod;12+ (void) classMethod;13@end14 15@implementation MyDerived16- (void) instanceMethod {17}18 19+ (void) classMethod {                    /* If a class method is not found, the root  */20    [self rootInstanceMethod];            /* class is searched for an instance method  */21    [MyIntermediate rootInstanceMethod];  /* with the same name.                       */22 23    [self instanceMethod];// expected-warning {{'+instanceMethod' not found (return type defaults to 'id')}}24    [MyDerived instanceMethod];// expected-warning {{'+instanceMethod' not found (return type defaults to 'id')}}25}26@end27 28@interface Object @end29 30@interface Class131- (void)setWindow:(Object *)wdw;32@end33 34@interface Class235- (void)setWindow:(Class1 *)window;36@end37 38#define nil (void*)039 40id foo(void) {41  Object *obj;42  id obj2 = obj;43  [obj setWindow:nil]; // expected-warning {{'Object' may not respond to 'setWindow:'}}44 45  return obj;46}47