diff options
author | Tobias Burnus <burnus@net-b.de> | 2015-02-05 21:58:38 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@net-b.de> | 2015-02-05 21:58:38 +0000 |
commit | 995c07ff9623fb61c12fbc674f8cc718ef29d919 (patch) | |
tree | 47b5b2c08e91e74456fbba7c2aabe9931702573f /gcc/fortran/resolve.c | |
parent | 82fecabf84f535cf387fcfb6c43306ff2b5a45d1 (diff) |
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@220462 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 3b0c12a0e6b..0b188dad05b 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -8364,7 +8364,8 @@ resolve_transfer (gfc_code *code) } 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 @@ -8375,8 +8376,7 @@ resolve_transfer (gfc_code *code) _("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) @@ -8436,6 +8436,11 @@ resolve_transfer (gfc_code *code) 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) |