| 1 |
/* { dg-do compile } */ |
| 2 |
|
| 3 |
#include "../objc-obj-c++-shared/TestsuiteObject.h" |
| 4 |
|
| 5 |
@protocol Foo |
| 6 |
- (id)meth1; |
| 7 |
- (id)meth2:(int)arg; |
| 8 |
@end |
| 9 |
|
| 10 |
@interface Derived1: TestsuiteObject |
| 11 |
@end |
| 12 |
|
| 13 |
@interface Derived2: TestsuiteObject |
| 14 |
+ (Derived1 *)new; |
| 15 |
@end |
| 16 |
|
| 17 |
id<Foo> func(void) { |
| 18 |
TestsuiteObject *o = [TestsuiteObject new]; |
| 19 |
return o; /* { dg-warning "class .TestsuiteObject. 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 |