| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! Fix a regession caused by the first patch for PR84674. |
| 4 |
! |
| 5 |
! Contributed by Juergen Reuter <[email protected]> |
| 6 |
! |
| 7 |
module m1 |
| 8 |
implicit none |
| 9 |
private |
| 10 |
public :: t1 |
| 11 |
type, abstract :: t1 |
| 12 |
end type t1 |
| 13 |
end module m1 |
| 14 |
|
| 15 |
module t_base |
| 16 |
use m1, only: t1 |
| 17 |
implicit none |
| 18 |
private |
| 19 |
public :: t_t |
| 20 |
type, abstract :: t_t |
| 21 |
contains |
| 22 |
procedure (t_out), deferred :: output |
| 23 |
end type t_t |
| 24 |
|
| 25 |
abstract interface |
| 26 |
subroutine t_out (t, handle) |
| 27 |
import |
| 28 |
class(t_t), intent(inout) :: t |
| 29 |
class(t1), intent(inout), optional :: handle |
| 30 |
end subroutine t_out |
| 31 |
end interface |
| 32 |
|
| 33 |
end module t_base |
| 34 |
|
| 35 |
|
| 36 |
module t_ascii |
| 37 |
use m1, only: t1 |
| 38 |
use t_base |
| 39 |
implicit none |
| 40 |
private |
| 41 |
|
| 42 |
type, abstract, extends (t_t) :: t1_t |
| 43 |
contains |
| 44 |
procedure :: output => t_ascii_output |
| 45 |
end type t1_t |
| 46 |
type, extends (t1_t) :: t2_t |
| 47 |
end type t2_t |
| 48 |
type, extends (t1_t) :: t3_t |
| 49 |
logical :: verbose = .true. |
| 50 |
end type t3_t |
| 51 |
|
| 52 |
interface |
| 53 |
module subroutine t_ascii_output & |
| 54 |
(t, handle) |
| 55 |
class(t1_t), intent(inout) :: t |
| 56 |
class(t1), intent(inout), optional :: handle |
| 57 |
end subroutine t_ascii_output |
| 58 |
end interface |
| 59 |
end module t_ascii |
| 60 |
|
| 61 |
submodule (t_ascii) t_ascii_s |
| 62 |
implicit none |
| 63 |
contains |
| 64 |
module subroutine t_ascii_output & |
| 65 |
(t, handle) |
| 66 |
class(t1_t), intent(inout) :: t |
| 67 |
class(t1), intent(inout), optional :: handle |
| 68 |
select type (t) |
| 69 |
type is (t3_t) |
| 70 |
type is (t2_t) |
| 71 |
class default |
| 72 |
return |
| 73 |
end select |
| 74 |
end subroutine t_ascii_output |
| 75 |
end submodule t_ascii_s |
| 76 |
|