Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Steve Naroff | e84a864 | 2008-09-28 14:55:53 +0000 | [diff] [blame] | 3 | |
| 4 | @interface Foo |
| 5 | @end |
| 6 | @implementation Foo |
| 7 | @end |
| 8 | |
| 9 | @implementation Foo(Whatever) |
| 10 | +(float)returnsFloat { return 7.0; } |
| 11 | @end |
| 12 | |
| 13 | @interface Foo (MoreStuff) |
| 14 | +(int)returnsInt; |
| 15 | @end |
| 16 | |
| 17 | @implementation Foo (MoreStuff) |
| 18 | +(int)returnsInt { |
| 19 | return 0; |
| 20 | } |
| 21 | |
| 22 | +(void)returnsNothing { |
| 23 | } |
| 24 | -(int)callsReturnsInt { |
| 25 | float f = [Foo returnsFloat]; // GCC doesn't find this method (which is a bug IMHO). |
| 26 | [Foo returnsNothing]; |
| 27 | return [Foo returnsInt]; |
| 28 | } |
| 29 | @end |
| 30 | |
| 31 | int main() {return 0;} |
| 32 | |