diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/class_41.f03')
-rw-r--r-- | gcc/testsuite/gfortran.dg/class_41.f03 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/class_41.f03 b/gcc/testsuite/gfortran.dg/class_41.f03 new file mode 100644 index 000000000..bcab2b4ce --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_41.f03 @@ -0,0 +1,24 @@ +! { dg-do compile } +! +! PR 48059: [4.6 Regression][OOP] ICE in in gfc_conv_component_ref: character function of extended type +! +! Contributed by Hans-Werner Boschmann <boschmann@tp1.physik.uni-siegen.de> + +module a_module + type :: a_type + integer::length=0 + end type a_type + type,extends(a_type) :: b_type + end type b_type +contains + function a_string(this) result(form) + class(a_type),intent(in)::this + character(max(1,this%length))::form + end function a_string + subroutine b_sub(this) + class(b_type),intent(inout),target::this + print *,a_string(this) + end subroutine b_sub +end module a_module + +! { dg-final { cleanup-modules "a_module" } } |