diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-01-15 03:51:16 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-01-15 03:51:16 +0000 |
commit | 2da229cb17e3fd65fdd12e9180d855ba583e1632 (patch) | |
tree | 848d6c46ac6746acb9d5369094fbeadb60b38c9e /gcc/fortran/io.c | |
parent | d5d9c650a27e31b6b2235c8b82b4430f8babfa25 (diff) | |
download | gcc-2da229cb17e3fd65fdd12e9180d855ba583e1632.zip gcc-2da229cb17e3fd65fdd12e9180d855ba583e1632.tar.gz gcc-2da229cb17e3fd65fdd12e9180d855ba583e1632.tar.bz2 |
re PR fortran/61933 (Inquire on internal units)
2015-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/61933
* io.c (gfc_match_inquire): Generate error if unit number in
inquire statement is a constant -1. All other values allowed.
* trans-io.c (gfc_trans_inquire): Delete dummy iostat variable.
(create_dummy_iostat): Delete function no longer used.
From-SVN: r219630
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 2bc80f3..a03984c 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -3998,6 +3998,14 @@ gfc_match_inquire (void) goto cleanup; } + if (inquire->unit != NULL && inquire->unit->expr_type == EXPR_CONSTANT + && inquire->unit->ts.type == BT_INTEGER + && mpz_get_si (inquire->unit->value.integer) == -1) + { + gfc_error ("UNIT number in INQUIRE statement at %L can not be -1", &loc); + goto cleanup; + } + if (gfc_pure (NULL)) { gfc_error ("INQUIRE statement not allowed in PURE procedure at %C"); |