Commit 6a68e29d by Janus Weil

re PR fortran/44962 ([OOP] ICE with specification expression SIZE(<CLASS>))

2010-07-29  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44962
	* resolve.c (resolve_fl_derived): Call gfc_resolve_array_spec.


2010-07-29  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44962
	* gfortran.dg/typebound_proc_17.f03: New.

From-SVN: r162695
parent 0f953f83
2010-07-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/44962
* resolve.c (resolve_fl_derived): Call gfc_resolve_array_spec.
2010-07-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/45004
* trans-stmt.h (gfc_trans_class_init_assign): New prototype.
(gfc_trans_class_assign): Modified prototype.
......
......@@ -10813,7 +10813,6 @@ resolve_fl_derived (gfc_symbol *sym)
{
gfc_symbol* super_type;
gfc_component *c;
int i;
super_type = gfc_get_derived_super_type (sym);
......@@ -11169,25 +11168,10 @@ resolve_fl_derived (gfc_symbol *sym)
&& sym != c->ts.u.derived)
add_dt_to_dt_list (c->ts.u.derived);
if (c->attr.pointer || c->attr.proc_pointer || c->attr.allocatable
|| c->as == NULL)
continue;
for (i = 0; i < c->as->rank; i++)
{
if (c->as->lower[i] == NULL
|| (resolve_index_expr (c->as->lower[i]) == FAILURE)
|| !gfc_is_constant_expr (c->as->lower[i])
|| c->as->upper[i] == NULL
|| (resolve_index_expr (c->as->upper[i]) == FAILURE)
|| !gfc_is_constant_expr (c->as->upper[i]))
{
gfc_error ("Component '%s' of '%s' at %L must have "
"constant array bounds",
c->name, sym->name, &c->loc);
return FAILURE;
}
}
if (gfc_resolve_array_spec (c->as, !(c->attr.pointer
|| c->attr.proc_pointer
|| c->attr.allocatable)) == FAILURE)
return FAILURE;
}
/* Resolve the type-bound procedures. */
......
2010-07-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/44962
* gfortran.dg/typebound_proc_17.f03: New.
2010-07-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/45004
* gfortran.dg/move_alloc_2.f90: New.
......
! { dg-do compile }
!
! PR 44962: [OOP] ICE with specification expression SIZE(<CLASS>)
!
! Contributed by Satish.BD <bdsatish@gmail.com>
module array
type :: t_array
real, dimension(10) :: coeff
contains
procedure :: get_coeff
end type t_array
contains
function get_coeff(self) result(coeff)
class(t_array), intent(in) :: self
real, dimension(size(self%coeff)) :: coeff !! The SIZE here carashes !!
end function get_coeff
end module array
! { dg-final { cleanup-modules "array" } }
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