+2015-02-05 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/64943
+ * resolve.c (resolve_transfer): Also check structure
+ constructors.
+
2015-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/64757
}
if (exp == NULL || (exp->expr_type != EXPR_VARIABLE
- && exp->expr_type != EXPR_FUNCTION))
+ && exp->expr_type != EXPR_FUNCTION
+ && exp->expr_type != EXPR_STRUCTURE))
return;
/* If we are reading, the variable will be changed. Note that
_("item in READ")))
return;
- sym = exp->symtree->n.sym;
- ts = &sym->ts;
+ ts = exp->expr_type == EXPR_STRUCTURE ? &exp->ts : &exp->symtree->n.sym->ts;
/* Go to actual component transferred. */
for (ref = exp->ref; ref; ref = ref->next)
return;
}
}
+
+ if (exp->expr_type == EXPR_STRUCTURE)
+ return;
+
+ sym = exp->symtree->n.sym;
if (sym->as != NULL && sym->as->type == AS_ASSUMED_SIZE && exp->ref
&& exp->ref->type == REF_ARRAY && exp->ref->u.ar.type == AR_FULL)
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/64943
+!
+! Contributed Dominique d'Humieres
+!
+ type :: Test
+ integer :: i
+ end type
+
+ type :: TestReference
+ class(Test), allocatable :: test(:)
+ end type
+print *, TestReference([Test(99), Test(199)]) ! { dg-error "Data transfer element at .1. cannot have ALLOCATABLE components unless it is processed by a defined input/output procedure" }
+end