46 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -Wundeclared-selector -verify -Wno-objc-root-class %s2 3typedef struct objc_selector *SEL;4 5@interface MyClass6 7+ (void) methodA;8- (void) methodB;9+ (void) methodD;10- (void) methodF;11 12@end13 14@implementation MyClass15 16+ (void) methodA {}17- (void) methodB {}18+ (void) methodD19{20 SEL d = @selector(methodD); /* Ok */21 SEL e = @selector(methodE);22}23 24- (void) methodE25{26 SEL e = @selector(methodE); /* Ok */27}28 29- (void) methodF30{31 SEL e = @selector(methodE); /* Ok */32}33 34@end35 36int main (void)37{38 SEL a = @selector(methodA); /* Ok */39 SEL b = @selector(methodB); /* Ok */40 SEL c = @selector(methodC); // expected-warning {{undeclared selector 'methodC'}}41 SEL d = @selector(methodD); /* Ok */42 SEL e = @selector(methodE); /* Ok */43 return 0;44 45}46