blob: 3adf79116561e6b729859f268a03ec6430c6d99f [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];
Fariborz Jahanian9f559832012-09-10 16:51:09 +000029} // expected-warning {{method possibly missing a [super XXX] call}}
Fariborz Jahanian84101132012-09-07 23:46:23 +000030@end
31