111
|
1 ! { dg-do compile }
|
|
2 !
|
|
3 ! PR 41556
|
|
4 ! Contributed by Damian Rouson <damian@rouson.net>
|
|
5
|
|
6 implicit none
|
|
7
|
|
8 type ,abstract :: object
|
|
9 contains
|
|
10 procedure(assign_interface) ,deferred :: assign
|
|
11 generic :: assignment(=) => assign
|
|
12 end type
|
|
13
|
|
14 abstract interface
|
|
15 subroutine assign_interface(lhs,rhs)
|
|
16 import :: object
|
|
17 class(object) ,intent(inout) :: lhs
|
|
18 class(object) ,intent(in) :: rhs
|
|
19 end subroutine
|
|
20 end interface
|
|
21
|
|
22 ! PR 41937
|
|
23 ! Contributed by Juergen Reuter <reuter@physik.uni-freiburg.de>
|
|
24
|
|
25 type, abstract :: cuba_abstract_type
|
|
26 integer :: dim_f = 1
|
|
27 real, dimension(:), allocatable :: integral
|
|
28 end type cuba_abstract_type
|
|
29
|
|
30 contains
|
|
31
|
|
32 subroutine cuba_abstract_alloc_dim_f(this)
|
|
33 class(cuba_abstract_type) :: this
|
|
34 allocate(this%integral(this%dim_f))
|
|
35 end subroutine cuba_abstract_alloc_dim_f
|
|
36
|
|
37 end
|