aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/comp-types-13.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/comp-types-13.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/comp-types-13.mm19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/comp-types-13.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/comp-types-13.mm
new file mode 100644
index 000000000..5e32cfe92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/obj-c++.dg/comp-types-13.mm
@@ -0,0 +1,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];
+}
+