Fariborz Jahanian | 8410113 | 2012-09-07 23:46:23 +0000 | [diff] [blame] | 1 | // 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 Jahanian | 9f55983 | 2012-09-10 16:51:09 +0000 | [diff] [blame^] | 29 | } // expected-warning {{method possibly missing a [super XXX] call}} |
Fariborz Jahanian | 8410113 | 2012-09-07 23:46:23 +0000 | [diff] [blame] | 30 | @end |
| 31 | |