diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-12-27 21:13:53 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-12-27 21:13:53 +0000 |
commit | 03b2d3defa7ef8c258d48f4bfbd66a08c27ea19c (patch) | |
tree | f4343792f2968948467d764eca2a4b1ccbd2369d /gcc/fortran/expr.c | |
parent | b3c64ed0b0589623146d28ebb41aa68b56cfeeca (diff) | |
download | gcc-03b2d3defa7ef8c258d48f4bfbd66a08c27ea19c.zip gcc-03b2d3defa7ef8c258d48f4bfbd66a08c27ea19c.tar.gz gcc-03b2d3defa7ef8c258d48f4bfbd66a08c27ea19c.tar.bz2 |
re PR fortran/81027 (Assumed-shape array reported as deferred.)
2018-12-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/81027
* expr.c (gfc_check_init_expr): Distinguish assumed-shape versus
deferred-shape dummy arguments in an error message.
2018-12-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/81027
* gfortran.dg/pr81027.f90: New test.
* gfortran.dg/initialization_7.f90: Update error message.
From-SVN: r267437
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 7a018ae..638b38d 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2869,9 +2869,16 @@ gfc_check_init_expr (gfc_expr *e) break; case AS_DEFERRED: - gfc_error ("Deferred array %qs at %L is not permitted " - "in an initialization expression", - e->symtree->n.sym->name, &e->where); + if (!e->symtree->n.sym->attr.allocatable + && !e->symtree->n.sym->attr.pointer + && e->symtree->n.sym->attr.dummy) + gfc_error ("Assumed-shape array %qs at %L is not permitted " + "in an initialization expression", + e->symtree->n.sym->name, &e->where); + else + gfc_error ("Deferred array %qs at %L is not permitted " + "in an initialization expression", + e->symtree->n.sym->name, &e->where); break; case AS_EXPLICIT: |