blob: ff682a41b367c0706f918f75015dd79cade17704 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
! { dg-do run }
!
! PR 49562: [4.6/4.7 Regression] [OOP] assigning value to type-bound function
!
! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de>
module ice
type::ice_type
contains
procedure::ice_func
end type
integer, target :: it = 0
contains
function ice_func(this)
integer, pointer :: ice_func
class(ice_type)::this
ice_func => it
end function ice_func
subroutine ice_sub(a)
class(ice_type)::a
a%ice_func() = 1
end subroutine ice_sub
end module
use ice
type(ice_type) :: t
if (it/=0) call abort()
call ice_sub(t)
if (it/=1) call abort()
end
! { dg-final { cleanup-modules "ice" } }
|