| 1 |
! { dg-do compile } |
| 2 |
! Tests the fix for PR35997, in which the use association of renamed |
| 3 |
! valid2 and flag2 was treated as if the renaming were done on use |
| 4 |
! association in the main program. Thus, the following, direct use |
| 5 |
! association of valid and flag did not occur. |
| 6 |
! |
| 7 |
! Contributed by Drew McCormack <[email protected]> |
| 8 |
! |
| 9 |
module funcinterfacemod |
| 10 |
interface |
| 11 |
logical function valid () |
| 12 |
end function |
| 13 |
end interface |
| 14 |
logical :: flag = .true. |
| 15 |
end module |
| 16 |
|
| 17 |
module secondmod |
| 18 |
use funcinterfacemod, valid2 => valid, flag2 => flag |
| 19 |
end module |
| 20 |
|
| 21 |
logical function valid () |
| 22 |
valid = .true. |
| 23 |
end function |
| 24 |
|
| 25 |
program main |
| 26 |
use secondmod |
| 27 |
use funcinterfacemod |
| 28 |
if (valid ()) then |
| 29 |
print *, 'Is Valid' |
| 30 |
endif |
| 31 |
if (flag) then |
| 32 |
print *, 'Is flag' |
| 33 |
endif |
| 34 |
end program |