llvm-project/clang/test/Analysis/ObjCRetSigs.m

26 lines
475 B
Objective-C

// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -warn-objc-methodsigs -verify %s
int printf(const char *, ...);
@interface MyBase
-(long long)length;
@end
@interface MySub : MyBase{}
-(double)length;
@end
@implementation MyBase
-(long long)length{
printf("Called MyBase -length;\n");
return 3;
}
@end
@implementation MySub
-(double)length{ // expected-warning{{types are incompatible}}
printf("Called MySub -length;\n");
return 3.3;
}
@end