Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / gfortran.dg / abstract_type_8.f03
blobc924abac9af46fbdef50d2fb654863e3001c1b07
1 ! { dg-do compile }
3 ! PR 44616: [OOP] ICE if CLASS(foo) is used before its definition
5 ! Contributed by bd satish <bdsatish@gmail.com>
7 module factory_pattern
8 implicit none
10 type First_Factory
11     character(len=20) :: factory_type
12     class(Connection), pointer :: connection_type
13     contains
14 end type First_Factory
16 type, abstract :: Connection
17     contains
18     procedure(generic_desc), deferred :: description
19 end type Connection
21 abstract interface
22     subroutine generic_desc(self)
23         import  ! Required, cf. PR 44614
24         class(Connection) :: self
25     end subroutine generic_desc
26 end interface
27 end module factory_pattern
29 ! { dg-final { cleanup-modules "factory_pattern" } }