1 // RUN: %clang_cc1 -fobjc-arc -fsyntax-only -verify -Wselector-type-mismatch %s
3 extern Class object_getClass(id);
5 __attribute__((objc_root_class))
8 + (void)directMethod __attribute__((objc_direct)); // expected-note {{direct method 'directMethod' declared here}}
9 + (void)anotherDirectMethod __attribute__((objc_direct));
15 return object_getClass(self);
17 + (void)directMethod {
19 + (void)anotherDirectMethod {
20 [self directMethod]; // this should not warn
22 + (void)regularMethod {
23 [self directMethod]; // this should not warn
24 [self anotherDirectMethod]; // this should not warn
26 - (void)regularInstanceMethod {
27 [[self class] directMethod]; // expected-error {{messaging a Class with a method that is possibly direct}}
36 [self directMethod]; // this should not warn
40 __attribute__((objc_root_class))
46 [self directMethod]; // expected-error {{no known class method for selector 'directMethod'}}