| 1 |
// RUN: %check_clang_tidy %s objc-forbidden-subclassing %t |
| 2 |
|
| 3 |
@interface UIImagePickerController |
| 4 |
@end |
| 5 |
|
| 6 |
@interface Foo : UIImagePickerController |
| 7 |
// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: Objective-C interface 'Foo' subclasses 'UIImagePickerController', which is not intended to be subclassed [objc-forbidden-subclassing] |
| 8 |
@end |
| 9 |
|
| 10 |
// Check subclasses of subclasses. |
| 11 |
@interface Bar : Foo |
| 12 |
// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: Objective-C interface 'Bar' subclasses 'UIImagePickerController', which is not intended to be subclassed [objc-forbidden-subclassing] |
| 13 |
@end |
| 14 |
|
| 15 |
@interface Baz |
| 16 |
@end |
| 17 |
|
| 18 |
// Make sure innocent subclasses aren't caught by the check. |
| 19 |
@interface Blech : Baz |
| 20 |
// CHECK-MESSAGES-NOT: :[[@LINE-1]]:12: warning: Objective-C interface 'Blech' subclasses 'Baz', which is not intended to be subclassed [objc-forbidden-subclassing] |
| 21 |
@end |