22 lines · plain
1// RUN: %check_clang_tidy %s bugprone-suspicious-semicolon %t2 3// This test checks if Objective-C 2.0 (@properties) and4// Automatic Reference Counting (ARC) are enabled for .m files5// checked via check_clang_tidy.py.6 7#if !__has_feature(objc_arc)8#error Objective-C ARC not enabled as expected9#endif10 11@interface Foo12@property (nonatomic, assign) int shouldDoStuff;13- (void)nop;14@end15 16void fail(Foo *f)17{18 if(f.shouldDoStuff); [f nop];19 // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: potentially unintended semicolon [bugprone-suspicious-semicolon]20 // CHECK-FIXES: if(f.shouldDoStuff) [f nop];21}22