blob: 758e1d7f56025d9943007790b7f08e4fb87315db [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -Wundeclared-selector -verify %s
Fariborz Jahanian0b6b0e92009-06-16 17:57:28 +00002
3typedef struct objc_selector *SEL;
4
5@interface MyClass
6
7+ (void) methodA;
8- (void) methodB;
9+ (void) methodD;
10- (void) methodF;
11
12@end
13
14@implementation MyClass
15
16+ (void) methodA {}
17- (void) methodB {}
18+ (void) methodD
19{
20 SEL d = @selector(methodD); /* Ok */
21 SEL e = @selector(methodE); // expected-warning {{undeclared selector 'methodE'}}
22}
23
24- (void) methodE
25{
26 SEL e = @selector(methodE); /* Ok */
27}
28
29- (void) methodF
30{
31 SEL e = @selector(methodE); /* Ok */
32}
33
34@end
35
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}