| 1 |
! { dg-do compile } |
| 2 |
! Tests the fix for 25103, in which the presence of automatic objects |
| 3 |
! in the main program and the specification part of a module was not |
| 4 |
! detected. |
| 5 |
! |
| 6 |
! Contributed by Joost VandeVondele <[email protected]> |
| 7 |
! |
| 8 |
! Error message update with patch for PR fortran/83633 |
| 9 |
! |
| 10 |
module foo |
| 11 |
integer :: i |
| 12 |
end module foo |
| 13 |
module bar |
| 14 |
use foo |
| 15 |
integer, dimension (i) :: j ! { dg-error "array with nonconstant bounds" } |
| 16 |
character (len = i) :: c1 ! { dg-error "must have constant character length" } |
| 17 |
end module bar |
| 18 |
program foobar |
| 19 |
use foo |
| 20 |
integer, dimension (i) :: k ! { dg-error "array with nonconstant bounds" } |
| 21 |
character (len = i) :: c2 ! { dg-error "must have constant character length" } |
| 22 |
end program foobar |