+2011-03-12 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/48059
+ * trans-expr.c (gfc_apply_interface_mapping_to_expr): Replace base type
+ for polymorphic arguments.
+
2011-03-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/48054
expr->symtree = sym->new_sym;
else if (sym->expr)
gfc_replace_expr (expr, gfc_copy_expr (sym->expr));
+ /* Replace base type for polymorphic arguments. */
+ if (expr->ref && expr->ref->type == REF_COMPONENT
+ && sym->expr && sym->expr->ts.type == BT_CLASS)
+ expr->ref->u.c.sym = sym->expr->ts.u.derived;
}
/* ...and to subexpressions in expr->value. */
+2011-03-12 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/48059
+ * gfortran.dg/class_41.f03: New.
+
2011-03-11 Dodji Seketeli <dodji@redhat.com>
* g++.dg/conversion/cast3.C: New test.
--- /dev/null
+! { 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" } }