5 ! Contributed by Neil Carlson
7 ! Check whether passing an intent(in) pointer
8 ! to an intent(inout) nonpointer is allowed
12 integer, pointer :: ptr
15 subroutine foo (a
,b
,c
)
16 type(typeA
), intent(in
) :: a
17 type(typeA
), intent(in
) , pointer :: b
18 class(typeA
), intent(in
) , pointer :: c
25 call bar2p (b
) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
26 call bar3p (b
) ! { dg-error "Actual argument to .n. at \\(1\\) must be polymorphic" }
27 call bar2p (c
) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
28 call bar3p (c
) ! { dg-error "INTENT\\(IN\\) in pointer association context \\(actual argument to INTENT = OUT/INOUT" }
31 integer, intent(inout
) :: n
34 type(typeA
), intent(inout
) :: n
37 class(typeA
), intent(inout
) :: n
40 type(typeA
), intent(inout
), pointer :: n
43 class(typeA
), intent(inout
), pointer :: n