OSDN Git Service

2010-11-05 Steve Ellcey <sje@cup.hp.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / comp-types-12.m
1 /* When assigning function pointers, allow for covariant return types
2    and contravariant argument types.  */
3 /* { dg-do compile } */
4 #include <objc/Object.h>
5
6 @class Derived;
7
8 Object *ExternFunc (Object *filePath, Object *key);
9 typedef id FuncSignature (Object *arg1, Derived *arg2);
10
11 @interface Derived: Object
12 + (void)registerFunc:(FuncSignature *)function;
13 @end
14
15 void foo(void)
16 {
17   [Derived registerFunc: ExternFunc];
18 }
19