1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! 15.5.1 procedure reference constraints and restrictions
4 subroutine s01(elem
, subr
)
6 !ERROR: A dummy procedure may not be ELEMENTAL
7 elemental
real function elem(x
)
8 real, intent(in
), value
:: x
10 subroutine subr(dummy
)
11 procedure(sin
) :: dummy
13 subroutine badsubr(dummy
)
15 !ERROR: A dummy procedure may not be ELEMENTAL
16 procedure(elem
) :: dummy
20 call subr(cos
) ! not an error
21 !ERROR: Non-intrinsic ELEMENTAL procedure 'elem' may not be passed as an actual argument
22 call subr(elem
) ! C1533
23 !ERROR: Actual argument associated with procedure dummy argument 'dummy=' is a null pointer
25 !ERROR: Actual argument associated with procedure dummy argument 'dummy=' is typeless
30 procedure(sin
) :: elem01
32 elemental
real function elem02(x
)
40 elemental
real function elem03(x
)
45 call callme(cos
) ! not an error
46 !ERROR: Non-intrinsic ELEMENTAL procedure 'elem01' may not be passed as an actual argument
47 call callme(elem01
) ! C1533
48 !ERROR: Non-intrinsic ELEMENTAL procedure 'elem02' may not be passed as an actual argument
49 call callme(elem02
) ! C1533
50 !ERROR: Non-intrinsic ELEMENTAL procedure 'elem03' may not be passed as an actual argument
51 call callme(elem03
) ! C1533
52 !ERROR: Non-intrinsic ELEMENTAL procedure 'elem04' may not be passed as an actual argument
53 call callme(elem04
) ! C1533
55 elemental
real function elem04(x
)
63 integer, pointer :: ptr
68 type(t
), intent(in
) :: x
71 !ERROR: Coindexed object 'coarray' with POINTER ultimate component '%ptr' cannot be associated with dummy argument 'x='
72 call callee(coarray
[1]) ! C1537
79 l
= index
.eq
. 0 ! index is an object entity, not an intrinsic
81 !ERROR: Actual argument associated with procedure dummy argument 'p=' is not a procedure
94 !ERROR: No explicit type declared for 'index'