OSDN Git Service

2010-03-25 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / comp-types-10.m
1 /* { dg-do compile } */
2
3 #include "../objc-obj-c++-shared/Object1.h"
4
5 @protocol Foo
6 - (id)meth1;
7 - (id)meth2:(int)arg;
8 @end
9
10 @interface Derived1: Object
11 @end
12
13 @interface Derived2: Object
14 + (Derived1 *)new;
15 @end
16
17 id<Foo> func(void) {
18   Object *o = [Object new];
19   return o;  /* { dg-warning "class .Object. does not implement the .Foo. protocol" } */
20 }
21
22 @implementation Derived2
23 + (Derived1 *)new {
24   Derived2 *o = [super new];
25   return o;  /* { dg-warning "distinct Objective\\-C type in return" } */
26 }
27 @end