Nico Weber | 9a1ecf0 | 2011-08-22 17:25:57 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | @protocol NSCopying @end |
| 4 | |
| 5 | @interface NSObject <NSCopying> |
| 6 | - (void)dealloc; |
| 7 | @end |
| 8 | |
| 9 | @implementation NSObject |
| 10 | - (void)dealloc { |
| 11 | // Root class, shouldn't warn |
| 12 | } |
| 13 | @end |
| 14 | |
| 15 | @interface Subclass1 : NSObject |
| 16 | - (void)dealloc; |
| 17 | @end |
| 18 | |
| 19 | @implementation Subclass1 |
| 20 | - (void)dealloc { |
| 21 | } // expected-warning{{method possibly missing a [super dealloc] call}} |
| 22 | @end |
| 23 | |
| 24 | @interface Subclass2 : NSObject |
| 25 | - (void)dealloc; |
| 26 | @end |
| 27 | |
| 28 | @implementation Subclass2 |
| 29 | - (void)dealloc { |
| 30 | [super dealloc]; // Shouldn't warn |
| 31 | } |
| 32 | @end |