| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/42769 |
| 4 |
! This test used to ICE in resolve_typebound_procedure because T1's GET |
| 5 |
! procedure was wrongly associated to MOD2's MY_GET (instead of the original |
| 6 |
! MOD1's MY_GET) in MOD3's SUB. |
| 7 |
! |
| 8 |
! Original testcase by Salvator Filippone <[email protected]> |
| 9 |
! Reduced by Janus Weil <[email protected]> |
| 10 |
|
| 11 |
module mod1 |
| 12 |
type :: t1 |
| 13 |
contains |
| 14 |
procedure, nopass :: get => my_get |
| 15 |
end type |
| 16 |
contains |
| 17 |
logical function my_get() |
| 18 |
end function |
| 19 |
end module |
| 20 |
|
| 21 |
module mod2 |
| 22 |
contains |
| 23 |
logical function my_get() |
| 24 |
end function |
| 25 |
end module |
| 26 |
|
| 27 |
module mod3 |
| 28 |
contains |
| 29 |
subroutine sub(a) |
| 30 |
use mod2, only: my_get |
| 31 |
use mod1, only: t1 |
| 32 |
type(t1) :: a |
| 33 |
end subroutine |
| 34 |
end module |
| 35 |
|
| 36 |
|
| 37 |
use mod2, only: my_get |
| 38 |
use mod3, only: sub |
| 39 |
end |
| 40 |
|
| 41 |
|
| 42 |
|