1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
2 ! Structure constructors with bad pointer targets
4 real, target
, save :: x
6 real, pointer :: rp
=> x
7 procedure(f
), pointer, nopass
:: pp
=> f
13 subroutine test(da
, dp
)
16 procedure(f
), pointer :: lpp
18 type(t
) :: a1
= t() ! ok
19 type(t
) :: a2
= t(rp
=x
) ! ok
20 type(t
) :: a3
= t(pp
=f
) ! ok
21 type(t
) :: a4
= t(pp
=ext
) ! ok
22 !ERROR: Must be a constant value
23 type(t
) :: a5
= t(rp
=y
)
24 !ERROR: Must be a constant value
25 type(t
) :: a6
= t(rp
=da
)
26 !ERROR: Must be a constant value
27 type(t
) :: a7
= t(pp
=lpp
)
28 !ERROR: Must be a constant value
29 type(t
) :: a8
= t(pp
=internal
)
30 !ERROR: Must be a constant value
31 type(t
) :: a9
= t(pp
=dp
)
33 real function internal()