+2007-11-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/34083
+ * resolve.c (resolve_structure_cons): Also check for zero rank.
+
2007-11-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33317
for (; comp; comp = comp->next, cons = cons->next)
{
+ int rank;
+
if (!cons->expr)
continue;
continue;
}
- if (cons->expr->expr_type != EXPR_NULL
- && comp->as && comp->as->rank != cons->expr->rank
+ rank = comp->as ? comp->as->rank : 0;
+ if (cons->expr->expr_type != EXPR_NULL && rank != cons->expr->rank
&& (comp->allocatable || cons->expr->rank))
{
gfc_error ("The rank of the element in the derived type "
"constructor at %L does not match that of the "
"component (%d/%d)", &cons->expr->where,
- cons->expr->rank, comp->as ? comp->as->rank : 0);
+ cons->expr->rank, rank);
t = FAILURE;
}
+2007-11-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/34083
+ * gfortran.dg/derived_constructor_comps_2.f90: Add check.
+
2007-11-20 Richard Guenther <rguenther@suse.de>
PR middle-end/34154
marge = homer (duff_beer) ! { dg-error "should be a POINTER or a TARGET" }
end
+!
+! The following yield an ICE, see PR 34083
+!
+subroutine foo
+ type ByteType
+ character(len=1) :: singleByte
+ end type
+ type (ByteType) :: bytes(4)
+
+ print *, size(bytes)
+ bytes = ByteType((/'H', 'i', '!', ' '/)) ! { dg-error "rank of the element in the derived type constructor" }
+end subroutine foo