aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/abstract_type_8.f03
blob: edcb37a6e11081417ecb6d3684e55f4b0a8ea91c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! { dg-do compile }
!
! PR 44616: [OOP] ICE if CLASS(foo) is used before its definition
!
! Contributed by bd satish <bdsatish@gmail.com>

module factory_pattern
implicit none

type First_Factory
    character(len=20) :: factory_type
    class(Connection), pointer :: connection_type
    contains
end type First_Factory

type, abstract :: Connection
    contains
    procedure(generic_desc), deferred :: description
end type Connection

abstract interface
    subroutine generic_desc(self)
        import  ! Required, cf. PR 44614
        class(Connection) :: self
    end subroutine generic_desc
end interface
end module factory_pattern