aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2018-12-11 01:39:23 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2018-12-11 01:39:23 +0000
commit87550b74a7eea661abe7ba09a3eff68902546081 (patch)
tree30b4e146d561a20572cf36b8bbbde0743d1904a3 /gcc/fortran/io.c
parent1486eb791fce1b48d24075e281afd09864713e52 (diff)
downloadgcc-87550b74a7eea661abe7ba09a3eff68902546081.zip
gcc-87550b74a7eea661abe7ba09a3eff68902546081.tar.gz
gcc-87550b74a7eea661abe7ba09a3eff68902546081.tar.bz2
2018-12-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/97922 * io.c (gfc_match_open): Additional checks on ASYNCHRONOUS. 2018-12-10 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/97922 * gfortran.dg/io_constraints_8.f90: Update error message. * gfortran.dg/pr87922.f90: New test. From-SVN: r266968
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 8d54107..8415df1 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -2205,6 +2205,21 @@ gfc_match_open (void)
if (!is_char_type ("ASYNCHRONOUS", open->asynchronous))
goto cleanup;
+ if (open->asynchronous->ts.kind != 1)
+ {
+ gfc_error ("ASYNCHRONOUS= specifier at %L must be of default "
+ "CHARACTER kind", &open->asynchronous->where);
+ return MATCH_ERROR;
+ }
+
+ if (open->asynchronous->expr_type == EXPR_ARRAY
+ || open->asynchronous->expr_type == EXPR_STRUCTURE)
+ {
+ gfc_error ("ASYNCHRONOUS= specifier at %L must be scalar",
+ &open->asynchronous->where);
+ return MATCH_ERROR;
+ }
+
if (open->asynchronous->expr_type == EXPR_CONSTANT)
{
static const char * asynchronous[] = { "YES", "NO", NULL };
@@ -3799,6 +3814,21 @@ if (condition) \
if (!is_char_type ("ASYNCHRONOUS", dt->asynchronous))
return MATCH_ERROR;
+ if (dt->asynchronous->ts.kind != 1)
+ {
+ gfc_error ("ASYNCHRONOUS= specifier at %L must be of default "
+ "CHARACTER kind", &dt->asynchronous->where);
+ return MATCH_ERROR;
+ }
+
+ if (dt->asynchronous->expr_type == EXPR_ARRAY
+ || dt->asynchronous->expr_type == EXPR_STRUCTURE)
+ {
+ gfc_error ("ASYNCHRONOUS= specifier at %L must be scalar",
+ &dt->asynchronous->where);
+ return MATCH_ERROR;
+ }
+
if (!compare_to_allowed_values
("ASYNCHRONOUS", asynchronous, NULL, NULL,
dt->asynchronous->value.character.string,