| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/64107 |
| 3 |
! Code contribute by fxcoudert at gcc dot gnu dot org |
| 4 |
! Appears to be fixed by patch for PR fortran/83633 |
| 5 |
module m1 |
| 6 |
|
| 7 |
contains |
| 8 |
pure integer function foo() |
| 9 |
foo = 2 |
| 10 |
end function |
| 11 |
end module |
| 12 |
|
| 13 |
subroutine test |
| 14 |
use m1 |
| 15 |
integer :: x1(foo()) |
| 16 |
end subroutine |
| 17 |
|
| 18 |
module m |
| 19 |
use m1 |
| 20 |
integer :: x2(foo()) ! { dg-error "array with nonconstant bounds" } |
| 21 |
contains |
| 22 |
subroutine sub |
| 23 |
integer :: x3(foo()) |
| 24 |
end subroutine |
| 25 |
end module |
| 26 |
|
| 27 |
program p |
| 28 |
use m1 |
| 29 |
integer :: x4(foo()) ! { dg-error "array with nonconstant bounds" } |
| 30 |
end program |