blob: c2da8e92af48cfda6b71cdf3cea448c7a14d0452 [file] [log] [blame]
Fariborz Jahanian84101132012-09-07 23:46:23 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
3// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify -Wno-objc-root-class %s
4// RUN: %clang_cc1 -x objective-c++ -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
5
6// rdar://6386358
7@protocol NSObject // expected-note {{protocol is declared here}}
8- MyDealloc __attribute((objc_requires_super)); // expected-warning {{'objc_requires_super' attribute cannot be applied to methods in protocols}}
9@end
10
11@interface Root
12- MyDealloc __attribute((objc_requires_super));
13- (void)XXX __attribute((objc_requires_super));
14- (void) dealloc __attribute((objc_requires_super)); // expected-warning {{'objc_requires_super' attribute cannot be applied to dealloc}}
15@end
16
17@interface Baz : Root<NSObject>
18- MyDealloc;
19@end
20
21@implementation Baz
22- MyDealloc {
23 [super MyDealloc];
24 return 0;
25}
26
27- (void)XXX {
28 [super MyDealloc];
29} // expected-warning {{method possibly missing a [super 'XXX'] call}}
30@end
31