2 ! { dg-options "-std=f2003 -fall-intrinsics" }
3 ! { dg-shouldfail "Invalid code" }
13 integer, pointer :: jp
=> null()
21 integer, pointer,intent(in
) :: p
22 p
=> null(p
)! { dg-error "Cannot assign to INTENT\\(IN\\) variable" }
23 nullify(p
) ! { dg-error "Cannot assign to INTENT\\(IN\\) variable" }
24 allocate(p
) ! { dg-error "Cannot allocate INTENT\\(IN\\) variable" }
25 call c(p
) ! { dg-error "is INTENT\\(IN\\) while interface specifies INTENT\\(INOUT\\)" }
26 deallocate(p
) ! { dg-error "Cannot deallocate INTENT\\(IN\\) variable" }
29 integer, pointer, intent(inout
) :: p
33 type(myT
),intent(in
) :: t
35 t
%jp
=> null(t
%jp
) ! { dg-error "Cannot assign to INTENT\\(IN\\) variable" }
36 nullify(t
%jp
) ! { dg-error "Cannot assign to INTENT\\(IN\\) variable" }
37 t
%j
= 7 ! { dg-error "Cannot assign to INTENT\\(IN\\) variable" }
38 allocate(t
%jp
) ! { dg-error "Cannot allocate INTENT\\(IN\\) variable" }
39 deallocate(t
%jp
) ! { dg-error "Cannot deallocate INTENT\\(IN\\) variable" }