Commit 2f72ca14 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/64943 (No error on ultimate allocatable components in IO list)

2015-02-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/64943
        * resolve.c (resolve_transfer): Also check structure
        constructors.

2015-02-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/64943
        * gfortran.dg/structure_constructor_12.f90: New.

From-SVN: r220462
parent 11c17039
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> 2015-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/64757 PR fortran/64757
......
...@@ -8364,7 +8364,8 @@ resolve_transfer (gfc_code *code) ...@@ -8364,7 +8364,8 @@ resolve_transfer (gfc_code *code)
} }
if (exp == NULL || (exp->expr_type != EXPR_VARIABLE if (exp == NULL || (exp->expr_type != EXPR_VARIABLE
&& exp->expr_type != EXPR_FUNCTION)) && exp->expr_type != EXPR_FUNCTION
&& exp->expr_type != EXPR_STRUCTURE))
return; return;
/* If we are reading, the variable will be changed. Note that /* If we are reading, the variable will be changed. Note that
...@@ -8375,8 +8376,7 @@ resolve_transfer (gfc_code *code) ...@@ -8375,8 +8376,7 @@ resolve_transfer (gfc_code *code)
_("item in READ"))) _("item in READ")))
return; return;
sym = exp->symtree->n.sym; ts = exp->expr_type == EXPR_STRUCTURE ? &exp->ts : &exp->symtree->n.sym->ts;
ts = &sym->ts;
/* Go to actual component transferred. */ /* Go to actual component transferred. */
for (ref = exp->ref; ref; ref = ref->next) for (ref = exp->ref; ref; ref = ref->next)
...@@ -8436,6 +8436,11 @@ resolve_transfer (gfc_code *code) ...@@ -8436,6 +8436,11 @@ resolve_transfer (gfc_code *code)
return; 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 if (sym->as != NULL && sym->as->type == AS_ASSUMED_SIZE && exp->ref
&& exp->ref->type == REF_ARRAY && exp->ref->u.ar.type == AR_FULL) && exp->ref->type == REF_ARRAY && exp->ref->u.ar.type == AR_FULL)
......
2015-02-05 Tobias Burnus <burnus@net-b.de>
PR fortran/64943
* gfortran.dg/structure_constructor_12.f90: New.
2015-02-05 Jeff Law <law@redhat.com> 2015-02-05 Jeff Law <law@redhat.com>
PR target/58400 PR target/58400
......
! { 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
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