Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / obj-c++.dg / comp-types-11.mm
blob8cd53404f5265e21f7a2704ac1f064576f087e41
1 /* { dg-do compile } */
3 #include <objc/Object.h>
5 @protocol Foo
6 - (id)meth1;
7 - (id)meth2:(int)arg;
8 @end
10 @interface Derived1: Object
11 @end
13 @interface Derived2: Object
14 + (Derived1 *)new;
15 @end
17 id<Foo> func(void) {
18   Object *o = [Object new];
19   return o;  /* { dg-warning "class .Object. does not implement the .Foo. protocol" } */
22 @implementation Derived2
23 + (Derived1 *)new {
24   Derived2 *o = [super new];
25   return o;  /* { dg-warning "distinct Objective\\-C type in return" } */
27 @end