Ted Kremenek | 5188507 | 2011-03-24 00:28:47 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core.experimental -analyzer-checker=osx.cocoa.IncompatibleMethodTypes -verify %s |
Ted Kremenek | 0d8019e | 2008-07-11 22:40:47 +0000 | [diff] [blame] | 2 | |
Daniel Dunbar | 23afaad | 2009-11-17 08:57:36 +0000 | [diff] [blame] | 3 | int printf(const char *, ...); |
Ted Kremenek | 0d8019e | 2008-07-11 22:40:47 +0000 | [diff] [blame] | 4 | |
| 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 |