summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/comp-types-13.mm
blob: 3a919d5d04cb6b93748e096461d6a0dae2351cbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* When assigning function pointers, allow for covariant return types
   and contravariant argument types.  */
/* { dg-do compile } */
#include <objc/Object.h>

@class Derived;

Object *ExternFunc (Object *filePath, Object *key);
typedef id FuncSignature (Object *arg1, Derived *arg2);

@interface Derived: Object
+ (void)registerFunc:(FuncSignature *)function;
@end

void foo(void)
{
  [Derived registerFunc: ExternFunc];
}