3 ! PR 42144: [OOP] deferred TBPs do not work
5 ! Contributed by Damian Rouson <damian@rouson.net>
11 type ,abstract :: field
15 module periodic_5th_order_module
16 use field_module ,only : field
18 type ,extends(field) :: periodic_5th_order
22 module field_factory_module
25 public :: field_factory
26 type, abstract :: field_factory
28 procedure(create_interface), deferred :: create
31 function create_interface(this)
32 use field_module ,only : field
33 import :: field_factory
34 class(field_factory), intent(in) :: this
35 class(field) ,pointer :: create_interface
40 module periodic_5th_factory_module
41 use field_factory_module , only : field_factory
44 public :: periodic_5th_factory
45 type, extends(field_factory) :: periodic_5th_factory
47 procedure :: create=>new_periodic_5th_order
50 function new_periodic_5th_order(this)
51 use field_module ,only : field
52 use periodic_5th_order_module ,only : periodic_5th_order
53 class(periodic_5th_factory), intent(in) :: this
54 class(field) ,pointer :: new_periodic_5th_order
59 use field_module ,only : field
60 use field_factory_module ,only : field_factory
61 use periodic_5th_factory_module ,only : periodic_5th_factory
63 class(field) ,pointer :: u
64 class(field_factory), allocatable :: field_creator
65 allocate (periodic_5th_factory :: field_creator)
66 u => field_creator%create()
69 ! { dg-final { cleanup-modules "field_module periodic_5th_order_module field_factory_module periodic_5th_factory_module" } }