Debian Codegraph @

gcc/testsuite/gfortran.dg/class_41.f03

raw
1 ! { dg-do compile }
2 !
3 ! PR 48059: [4.6 Regression][OOP] ICE in in gfc_conv_component_ref: character function of extended type
4 !
5 ! Contributed by Hans-Werner Boschmann <[email protected]>
6
7 module a_module
8 type :: a_type
9 integer::length=0
10 end type a_type
11 type,extends(a_type) :: b_type
12 end type b_type
13 contains
14 function a_string(this) result(form)
15 class(a_type),intent(in)::this
16 character(max(1,this%length))::form
17 end function a_string
18 subroutine b_sub(this)
19 class(b_type),intent(inout),target::this
20 print *,a_string(this)
21 end subroutine b_sub
22 end module a_module