Commit b53abf71 by Janus Weil

re PR fortran/48699 ([OOP] MOVE_ALLOC inside SELECT TYPE)

2011-06-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/48699
	* check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic,
	make sure the vtab is present.

2011-06-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/48699
	* gfortran.dg/move_alloc_5.f90: New.

From-SVN: r175151
parent f64a6f1e
2011-06-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/48699
* check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic,
make sure the vtab is present.
2011-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/49074
......
......@@ -2672,6 +2672,10 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
return FAILURE;
}
/* CLASS arguments: Make sure the vtab is present. */
if (to->ts.type == BT_CLASS)
gfc_find_derived_vtab (from->ts.u.derived);
return SUCCESS;
}
......
2011-06-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/48699
* gfortran.dg/move_alloc_5.f90: New.
2011-06-17 Hans-Peter Nilsson <hp@axis.com>
PR rtl-optimization/48542
......
! { dg-do run }
!
! PR 48699: [4.6/4.7 Regression] [OOP] MOVE_ALLOC inside SELECT TYPE
!
! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
program testmv1
type bar
end type
type, extends(bar) :: bar2
end type
class(bar), allocatable :: sm
type(bar2), allocatable :: sm2
allocate (sm2)
call move_alloc (sm2,sm)
if (allocated(sm2)) call abort()
if (.not. allocated(sm)) call abort()
end program
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