3 ! Dummy arguments are disallowed in initialization expressions in
4 ! elemental functions except as arguments to the intrinsic functions
5 ! BIT_SIZE, KIND, LEN, or to the numeric inquiry functions listed
10 ELEMENTAL
REAL FUNCTION two(N
)
11 INTEGER, INTENT(IN
) :: N
12 INTEGER, DIMENSION(N
) :: scr
! { dg-error "Dummy argument 'n' not allowed in expression" }
15 ELEMENTAL
REAL FUNCTION twopointfive(N
)
16 INTEGER, INTENT(IN
) :: N
17 INTEGER, DIMENSION(MAX(N
,2)) :: scr
! { dg-error "Dummy argument 'n' not allowed in expression" }
18 end FUNCTION twopointfive
20 REAL FUNCTION three(N
)
21 INTEGER, INTENT(IN
) :: N
22 INTEGER, DIMENSION(N
) :: scr
! this time it's valid
25 ELEMENTAL
REAL FUNCTION four(N
)
26 INTEGER, INTENT(IN
) :: N
27 INTEGER, DIMENSION(bit_size(N
)) :: scr
! another valid variant
30 ELEMENTAL
REAL FUNCTION gofourit(N
)
31 INTEGER, INTENT(IN
) :: N
32 INTEGER, DIMENSION(MIN(HUGE(N
),1)) :: scr
! another valid variant
35 ELEMENTAL
REAL FUNCTION fourplusone(N
)
36 INTEGER, INTENT(IN
) :: N
37 INTEGER, DIMENSION(M
) :: scr
! another valid variant
40 ELEMENTAL
REAL FUNCTION five(X
)
42 CHARACTER(LEN
=PRECISION(X
)) :: C
! valid again