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
This commit is contained in:
Janus Weil 2010-07-29 22:58:57 +02:00
parent 0f953f83c2
commit 6a68e29dc5
4 changed files with 40 additions and 20 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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. */

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,26 @@
! { 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" } }