2 ! PR fortran/114474 - DATA and derived types with pointer components
6 integer, target
:: ii
= 42 ! initial data target
8 integer, target
:: jj
= 24
9 integer, pointer :: qq
=> jj
10 ! ii and jj resolve slightly differently when the data statement below
11 ! is reached, as jj is resolved outside the structure constructor first
17 integer, target
:: kk(7) = 23
18 integer, pointer :: ll(:) => kk
24 type(t
) :: x1
, x2
, x3
, x4
, x5
25 type(t
), parameter :: z1
= t(null())
27 type(t1
), target
:: tt
= t1([1,2,3,4,5,6,7])
28 type(t1
), parameter :: vv
= t1(22)
30 integer, pointer :: p1(:) => tt
% m
33 data x2
/ t(ii
) / ! ii is initial data target
34 data x3
/ t(jj
) / ! jj is resolved differently...
35 data x4
/ t(tt
%m(3)) / ! pointer association with 3rd element
40 if ( associated (x1
% h
)) stop 1
41 if (.not
. associated (x2
% h
)) stop 2
42 if (.not
. associated (x3
% h
)) stop 3
43 if (.not
. associated (x4
% h
)) stop 4
44 if (x2
% h
/= 42) stop 5
45 if (x3
% h
/= 24) stop 6
46 if (x4
% h
/= 3) stop 7
48 if (any (w1
%m
/= 12 )) stop 8
49 if (any (w2
%m
/= vv
%m
)) stop 9
57 real function myfun (x
)
63 procedure(myfun
), pointer, nopass
:: p
66 type(u
) :: u3
= u(null())
67 type(u
), parameter :: u4
= u(null())
74 real function myfun (x
)