Commit 4c46bf2e by Erik Edelmann Committed by Paul Thomas

re PR fortran/19929 (Deallocation of an allocated derived type component causes failure)

2005-09-21  Erik Edelmann  <erik.edelmann@iki.fi>

	PR fortran/19929
	* trans-stmt.c (gfc_trans_deallocate): Check if the
	object to be deallocated is an array by looking at
	expr->rank instead of expr->symtree->n.sym->attr.dimension.

2005-09-21  Erik Edelmann  <erik.edelmann@iki.fi>

	PR fortran/19929
	* gfortran.dg/der_ptr_component_1.f90: New test.

From-SVN: r104495
parent 647c66cd
2005-09-21 Erik Edelmann <erik.edelmann@iki.fi>
PR fortran/19929
* trans-stmt.c (gfc_trans_deallocate): Check if the
object to be deallocated is an array by looking at
expr->rank instead of expr->symtree->n.sym->attr.dimension.
2005-09-20 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/23420
......
......@@ -3277,7 +3277,7 @@ gfc_trans_deallocate (gfc_code * code)
se.descriptor_only = 1;
gfc_conv_expr (&se, expr);
if (expr->symtree->n.sym->attr.dimension)
if (expr->rank)
tmp = gfc_array_deallocate (se.expr, pstat);
else
{
......
2005-09-21 Erik Edelmann <erik.edelmann@iki.fi>
PR fortran/19929
* gfortran.dg/der_ptr_component_1.f90: New test.
2005-09-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/23965
! { dg-do compile }
! PR 19929
! Deallocation of pointer components of derived type arrays
program der_ptr_component
type :: t
integer, pointer :: p
end type t
type(t) :: a(1)
allocate(a(1)%p)
deallocate(a(1)%p)
end program der_ptr_component
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