brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · fe7210e Raw
40 lines · plain
1// RUN: %check_clang_tidy %s objc-forbidden-subclassing %t \2// RUN: -config='{CheckOptions: \3// RUN:  {objc-forbidden-subclassing.ClassNames: "Foo;Quux"}}' \4// RUN: --5 6@interface UIImagePickerController7@end8 9// Make sure custom config options replace (not add to) the default list.10@interface Waldo : UIImagePickerController11// CHECK-MESSAGES-NOT: :[[@LINE-1]]:12: warning: Objective-C interface 'Waldo' subclasses 'UIImagePickerController', which is not intended to be subclassed [objc-forbidden-subclassing]12@end13 14@interface Foo15@end16 17@interface Bar : Foo18// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: Objective-C interface 'Bar' subclasses 'Foo', which is not intended to be subclassed [objc-forbidden-subclassing]19@end20 21// Check subclasses of subclasses.22@interface Baz : Bar23// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: Objective-C interface 'Baz' subclasses 'Foo', which is not intended to be subclassed [objc-forbidden-subclassing]24@end25 26@interface Quux27@end28 29// Check that more than one forbidden superclass can be specified.30@interface Xyzzy : Quux31// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: Objective-C interface 'Xyzzy' subclasses 'Quux', which is not intended to be subclassed [objc-forbidden-subclassing]32@end33 34@interface Plugh35@end36 37@interface Corge : Plugh38// CHECK-MESSAGES-NOT: :[[@LINE-1]]:12: warning: Objective-C interface 'Corge' subclasses 'Plugh', which is not intended to be subclassed [objc-forbidden-subclassing]39@end40