Debian Codegraph @

gcc/testsuite/gfortran.dg/bind_c_usage_3.f03

raw
1 ! { dg-do compile }
2 module test
3 use, intrinsic :: iso_c_binding
4
5 type, bind(c) :: my_c_type ! { dg-error "BIND.C. derived type" }
6 integer(c_int), pointer :: ptr ! { dg-error "cannot have the POINTER attribute" }
7 end type my_c_type
8
9 type, bind(c) :: my_type ! { dg-error "BIND.C. derived type" }
10 integer(c_int), allocatable :: ptr(:) ! { dg-error "cannot have the ALLOCATABLE attribute" }
11 end type my_type
12
13 type foo ! { dg-error "must have the BIND attribute" }
14 integer(c_int) :: p
15 end type foo
16
17 type(foo), bind(c) :: cp ! { dg-error "is not C interoperable" }
18 real(c_double), pointer,bind(c) :: p ! { dg-error "cannot have both the POINTER and BIND.C." }
19 end module test