brintos

brintos / llvm-project-archived public Read only

0
0
Text · 969 B · 4785503 Raw
48 lines · plain
1// RUN: %check_clang_tidy %s objc-dealloc-in-category %t2 3@interface NSObject4// Used to quash warning about missing base class.5- (void)dealloc;6@end7 8@interface Foo : NSObject9@end10 11@implementation Foo12- (void)dealloc {13  // No warning should be generated here.14}15@end16 17@interface Bar : NSObject18@end19 20@interface Bar (BarCategory)21@end22 23@implementation Bar (BarCategory)24+ (void)dealloc {25  // Should not trigger on class methods.26}27 28- (void)dealloc {29  // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: category 'BarCategory' should not implement -dealloc [objc-dealloc-in-category]30}31@end32 33@interface Baz : NSObject34@end35 36@implementation Baz37- (void)dealloc {38  // Should not trigger on implementation in the class itself, even with39  // it declared in the category (below).40}41@end42 43@interface Baz (BazCategory)44// A declaration in a category @interface does not by itself provide an45// overriding implementation, and should not generate a warning.46- (void)dealloc;47@end48