aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2019-06-22 19:58:47 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2019-06-22 19:58:47 +0000
commitb1be0054be0149ad735e662912e01ebd258cea49 (patch)
treece4faece62008dcdeb8ded3738ea6ae5fa589eb3 /gcc/fortran/io.c
parentd9fe6cc4251d68866779f3e8d86af1a050fa2ae5 (diff)
downloadgcc-b1be0054be0149ad735e662912e01ebd258cea49.zip
gcc-b1be0054be0149ad735e662912e01ebd258cea49.tar.gz
gcc-b1be0054be0149ad735e662912e01ebd258cea49.tar.bz2
re PR fortran/89782 (Can do an internal READ of a character array when it is a parameter, but not a scalar character parameter)
2019-06-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/89782 * io.c (gfc_resolve_dt): Check that internal units are not character PARAMETER. * gfortran.dg/io_constraints.f90: New test. From-SVN: r272594
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 425c2b8..cd21c6b 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -3328,6 +3328,14 @@ gfc_resolve_dt (gfc_dt *dt, locus *loc)
return false;
}
+ if (e->symtree && e->symtree->n.sym->attr.flavor == FL_PARAMETER
+ && e->ts.type == BT_CHARACTER)
+ {
+ gfc_error ("UNIT specification at %L must "
+ "not be a character PARAMETER", &e->where);
+ return false;
+ }
+
if (gfc_resolve_expr (e)
&& (e->ts.type != BT_INTEGER
&& (e->ts.type != BT_CHARACTER || e->expr_type != EXPR_VARIABLE)))