* tree-loop-distribution.c (struct partition): New field recording
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_class_4.f90
blob125d99f4d865740746c080afc5245d2c2207d5b5
1 ! { dg-do compile }
3 ! Part of PR 51946, but breaks easily, therefore introduce its own test
4 ! Authors: Damian Rouson <damian@sourceryinstitute.org>,
5 ! Dominique Pelletier <dominique.pelletier@polymtl.ca>
6 ! Contributed by: Andre Vehreschild <vehre@gcc.gnu.org>
8 module integrable_model_module
10 implicit none
12 type, abstract, public :: integrable_model
13 contains
14 procedure(default_constructor), deferred :: empty_instance
15 end type
17 abstract interface
18 function default_constructor(this) result(blank_slate)
19 import :: integrable_model
20 class(integrable_model), intent(in) :: this
21 class(integrable_model), allocatable :: blank_slate
22 end function
23 end interface
25 contains
27 subroutine integrate(this)
28 class(integrable_model), intent(inout) :: this
29 class(integrable_model), allocatable :: residual
30 allocate(residual, source=this%empty_instance())
31 end subroutine
33 end module integrable_model_module