| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/55638 |
| 4 |
! |
| 5 |
! Additionally, VALUE no INTENT is required (and only "intent(in)" allowed) |
| 6 |
! |
| 7 |
|
| 8 |
elemental subroutine foo(x, y, z) |
| 9 |
integer, intent(inout) :: x |
| 10 |
integer, VALUE :: y |
| 11 |
integer, VALUE, intent(in) :: z |
| 12 |
x = y |
| 13 |
end subroutine foo |
| 14 |
|
| 15 |
impure elemental subroutine foo2(x, y, z) ! { dg-error "Argument 'x' of elemental procedure 'foo2' at .1. must have its INTENT specified or have the VALUE attribute" } |
| 16 |
integer :: x |
| 17 |
integer, VALUE :: y |
| 18 |
integer, VALUE :: z |
| 19 |
x = y |
| 20 |
end subroutine foo2 |
| 21 |
|
| 22 |
subroutine foo3(x, y, z) |
| 23 |
integer, VALUE, intent(in) :: x |
| 24 |
integer, VALUE, intent(inout) :: y ! { dg-error "VALUE attribute conflicts with INTENT.INOUT. attribute" } |
| 25 |
integer, VALUE, intent(out) :: z ! { dg-error "VALUE attribute conflicts with INTENT.OUT. attribute" } |
| 26 |
end subroutine foo3 |