aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/objc.dg/comp-types-12.m
blob: 5e32cfe92338539d40e8d1d81a2daada23a695cb (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-obj-c++-shared/TestsuiteObject.h"

@class Derived;

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

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

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