11 procedure(), pointer :: bar
12 integer, pointer :: bari
13 call c_f_procpointer(fptr
,bar
) ! { dg-error "Argument CPTR at .1. to C_F_PROCPOINTER shall have the type TYPE.C_FUNPTR." }
14 call c_f_pointer(fun
,bari
) ! { dg-error "Argument CPTR at .1. to C_F_POINTER shall have the type TYPE.C_PTR." }
15 fun
= fptr
! { dg-error "Can't convert TYPE.c_ptr. to TYPE.c_funptr." }
19 use iso_c_binding
, c_ptr2
=> c_ptr
21 procedure(), pointer :: bar
22 integer, pointer :: foo
23 call c_f_procpointer(fun
,bar
) ! { dg-error "Argument CPTR at .1. to C_F_PROCPOINTER shall have the type TYPE.C_FUNPTR." }
24 call c_f_pointer(fun
,foo
) ! OK
28 use, intrinsic :: iso_c_binding
, only
: my_c_ptr_0
=> c_ptr
32 use, intrinsic :: iso_c_binding
, my_c_ptr
=> c_ptr
33 type(my_c_ptr
) :: my_ptr
34 print *,c_associated(my_ptr
)
38 type(my_c_ptr_0
) :: my_ptr2
39 type(c_funptr
) :: myfun
40 print *,c_associated(my_ptr
,my_ptr2
)
41 print *,c_associated(my_ptr
,myfun
) ! { dg-error "Argument C_PTR_2 at .1. to C_ASSOCIATED shall have the same type as C_PTR_1: TYPE.c_ptr. instead of TYPE.c_funptr." }