OSDN Git Service

2011-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / abstract_type_8.f03
1 ! { dg-do compile }
2 !
3 ! PR 44616: [OOP] ICE if CLASS(foo) is used before its definition
4 !
5 ! Contributed by bd satish <bdsatish@gmail.com>
6
7 module factory_pattern
8 implicit none
9
10 type First_Factory
11     character(len=20) :: factory_type
12     class(Connection), pointer :: connection_type
13     contains
14 end type First_Factory
15
16 type, abstract :: Connection
17     contains
18     procedure(generic_desc), deferred :: description
19 end type Connection
20
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
28
29 ! { dg-final { cleanup-modules "factory_pattern" } }