Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
      2 // expected-no-diagnostics
      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 
     33