OSDN Git Service

* obj-c++.dg/stubify-1.mm: Only run on powerpc.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / comp-types-11.mm
1 /* { dg-do compile } */
2
3 #include <objc/Object.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