blob: 13078a32232bbc6f07136072020b5bc1b4f0092a [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.core -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify -Wno-objc-root-class %s
Ted Kremenek0d8019e2008-07-11 22:40:47 +00002
Daniel Dunbar23afaad2009-11-17 08:57:36 +00003int printf(const char *, ...);
Ted Kremenek0d8019e2008-07-11 22:40:47 +00004
5@interface MyBase
6-(long long)length;
7@end
8
9@interface MySub : MyBase{}
10-(double)length;
11@end
12
13@implementation MyBase
14-(long long)length{
15 printf("Called MyBase -length;\n");
16 return 3;
17}
18@end
19
20@implementation MySub
21-(double)length{ // expected-warning{{types are incompatible}}
22 printf("Called MySub -length;\n");
23 return 3.3;
24}
25@end