2017-11-05 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / iso_c_binding_init_expr.f03
blob45eaa5c2443df8f9c4e68576a413b4db73cc57b0
1 ! { dg-do compile }
2 ! PR fortran/42354
4 use iso_c_binding
5 implicit none
6 integer, target :: a
7 type t
8   type(c_ptr) :: ptr = c_loc(a)    ! { dg-error "Intrinsic function 'c_loc' at .1. is not permitted in an initialization expression" }
9 end type t
10 type(c_ptr) :: ptr2 = c_loc(a)     ! { dg-error "Intrinsic function 'c_loc' at .1. is not permitted in an initialization expression" }
11 end