| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/30973 |
| 3 |
! Using symbols with the name of the module |
| 4 |
|
| 5 |
module foo |
| 6 |
integer :: i |
| 7 |
end module foo |
| 8 |
|
| 9 |
module bar |
| 10 |
integer :: j |
| 11 |
end module bar |
| 12 |
|
| 13 |
module test |
| 14 |
use foo, only: |
| 15 |
integer :: foo ! { dg-error "cannot have a type" } |
| 16 |
end module test |
| 17 |
|
| 18 |
module test2 |
| 19 |
use bar, only: foo => j |
| 20 |
use foo ! ok, unless foo is accessed |
| 21 |
end module test2 |
| 22 |
|
| 23 |
module test3 |
| 24 |
use bar, only: foo => j |
| 25 |
use foo ! ok, unless foo is accessed |
| 26 |
foo = 5 ! { dg-error "is an ambiguous reference to 'j'" } |
| 27 |
end module test3 |
| 28 |
|
| 29 |
program test_foo |
| 30 |
use foo, only: foo ! { dg-error "been used as an external module name" } |
| 31 |
use foo, only: i => foo! { dg-error "been used as an external module name" } |
| 32 |
use foo, only: foo => i! { dg-error "been used as an external module name" } |
| 33 |
end program |