1 // RUN: %clang_cc1 %s -fsyntax-only -Wcast-function-type -verify
2 // RUN: %clang_cc1 %s -fsyntax-only -Wcast-function-type-strict -verify
5 int t(int array
[static 12]);
10 typedef int (f1
)(long);
11 typedef int (f2
)(void*);
14 typedef void (f5
)(void);
15 typedef int (f6
)(long, int);
16 typedef int (f7
)(long,...);
17 typedef int (f8
)(int *);
18 typedef int (f9
)(const int);
19 typedef int (f10
)(int);
34 b
= (f2
*)x
; /* expected-warning {{cast from 'int (*)(long)' to 'f2 *' (aka 'int (*)(void *)') converts to incompatible function type}} */
35 c
= (f3
*)x
; /* expected-warning {{cast from 'int (*)(long)' to 'f3 *' (aka 'int (*)()') converts to incompatible function type}} */
36 d
= (f4
*)x
; /* expected-warning {{cast from 'int (*)(long)' to 'f4 *' (aka 'void (*)()') converts to incompatible function type}} */
37 e
= (f5
*)x
; /* expected-warning {{cast from 'int (*)(long)' to 'f5 *' (aka 'void (*)(void)') converts to incompatible function type}} */
38 f
= (f6
*)x
; /* expected-warning {{cast from 'int (*)(long)' to 'f6 *' (aka 'int (*)(long, int)') converts to incompatible function type}} */
39 g
= (f7
*)x
; /* expected-warning {{cast from 'int (*)(long)' to 'f7 *' (aka 'int (*)(long, ...)') converts to incompatible function type}} */
42 j
= (f10
*)v
; /* expected-warning {{cast from 'const int (*)(int)' to 'f10 *' (aka 'int (*)(int)') converts to incompatible function type}} */