Commit 750b874c authored by janus's avatar janus
Browse files

2010-06-11 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/42051
	PR fortran/43896
	* trans-expr.c (gfc_conv_derived_to_class): Handle array-valued
	functions with CLASS formal arguments.


2010-06-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/42051
	PR fortran/43896
	* gfortran.dg/class_23.f03: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160622 138bc75d-0d04-0410-961f-82ee72b054a4
parent f4f18004
2010-06-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/42051
PR fortran/43896
* trans-expr.c (gfc_conv_derived_to_class): Handle array-valued
functions with CLASS formal arguments.
2010-06-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/44207
......
......@@ -2492,12 +2492,14 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e,
ss = gfc_walk_expr (e);
if (ss == gfc_ss_terminator)
{
parmse->ss = NULL;
gfc_conv_expr_reference (parmse, e);
tmp = fold_convert (TREE_TYPE (ctree), parmse->expr);
gfc_add_modify (&parmse->pre, ctree, tmp);
}
else
{
parmse->ss = ss;
gfc_conv_expr (parmse, e);
gfc_add_modify (&parmse->pre, ctree, parmse->expr);
}
......
2010-06-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/42051
PR fortran/43896
* gfortran.dg/class_23.f03: New test.
2010-06-11 Jan Hubicka <jh@suse.cz>
* gcc.dg/ipa/pure-const-2.c: New testcase.
......
! { dg-do compile }
!
! PR 42051: [OOP] ICE on array-valued function with CLASS formal argument
!
! Original test case by Damian Rouson <damian@rouson.net>
! Modified by Janus Weil <janus@gcc.gnu.org>
type grid
end type
contains
function return_x(this) result(this_x)
class(grid) :: this
real ,dimension(1) :: this_x
end function
subroutine output()
type(grid) :: mesh
real ,dimension(1) :: x
x = return_x(mesh)
end subroutine
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment