PR fortran/46413
* resolve.c (resolve_transfer): Reject I/O transfer of
polymorphic type.
PR fortran/46205
* resolve.c (resolve_code): Reject nonscalar FORALL masks.
2010-11-11 Tobias Burnus <burnus@net-b.de>
PR fortran/46413
* gfortran.dg/class_31.f90: New.
PR fortran/46205
* gfortran.dg/forall_14.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166631
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-11-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/46413
+ * resolve.c (resolve_transfer): Reject I/O transfer of
+ polymorphic type.
+
+ PR fortran/46205
+ * resolve.c (resolve_code): Reject nonscalar FORALL masks.
+
2010-11-11 Janus Weil <janus@gcc.gnu.org>
* resolve.c (resolve_procedure_interface): Copy 'is_bind_c' attribute.
if (ref->type == REF_COMPONENT)
ts = &ref->u.c.component->ts;
+ if (ts->type == BT_CLASS)
+ {
+ /* FIXME: Test for defined input/output. */
+ gfc_error ("Data transfer element at %L cannot be polymorphic unless "
+ "it is processed by a defined input/output procedure",
+ &code->loc);
+ return;
+ }
+
if (ts->type == BT_DERIVED)
{
/* Check that transferred derived type doesn't contain POINTER
case EXEC_FORALL:
resolve_forall_iterators (code->ext.forall_iterator);
- if (code->expr1 != NULL && code->expr1->ts.type != BT_LOGICAL)
- gfc_error ("FORALL mask clause at %L requires a LOGICAL "
+ if (code->expr1 != NULL
+ && (code->expr1->ts.type != BT_LOGICAL || code->expr1->rank))
+ gfc_error ("FORALL mask clause at %L requires a scalar LOGICAL "
"expression", &code->expr1->where);
break;
+2010-11-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/46413
+ * gfortran.dg/class_31.f90: New.
+
+ PR fortran/46205
+ * gfortran.dg/forall_14.f90: New.
+
2010-11-11 Jakub Jelinek <jakub@redhat.com>
Tobias Burnus <burnus@net-b.de>
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/46413
+!
+type t
+ integer :: ii =5
+end type t
+class(t), allocatable :: x
+allocate (t :: x)
+
+print *,x ! { dg-error "Data transfer element at .1. cannot be polymorphic" }
+end
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/46205
+!
+! Contributed by Jonathan Stott
+!
+
+program forallBug
+ logical :: valid(4) = (/ .true., .true., .false., .true. /)
+ real :: vec(4)
+ integer :: j
+
+ ! This is an illegal statement. It should read valid(j), not valid.
+ forall (j = 1:4, valid) ! { dg-error "requires a scalar LOGICAL expression" }
+ vec(j) = sin(2*3.14159/j)
+ end forall
+end program forallBug