2015-07-24 11:25:13 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify -Wno-objc-root-class %s
|
2008-07-12 06:40:47 +08:00
|
|
|
|
2009-11-17 16:57:36 +08:00
|
|
|
int printf(const char *, ...);
|
2008-07-12 06:40:47 +08:00
|
|
|
|
|
|
|
@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
|