summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2019-05-15 21:02:36 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2019-05-15 21:02:36 +0300
commit0c15ebf1bd0d7ec8111acfecf71542acac4115b1 (patch)
treed8d96f02445161f81d85ccf4298ddc0a5f9fa39e /libgfortran
parent40c81f845c6f1c5e6df74442ca59279090ac1e8d (diff)
Allow opening file on multiple units
As of Fortran 2018 it's allowed to open the same file on multiple units. libgfortran/ChangeLog: 2019-05-15 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/90461 * io/open.c (new_unit): Don't check if the file is already open for F2018. testsuite/ChangeLog: 2019-05-15 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/90461 * gfortran.dg/open_errors_2.f90: Add -std=f2008, adjust line number. * gfortran.dg/open_errors_3.f90: New test. From-SVN: r271260
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/open.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 72b70a0c559..4b5194f4406 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2019-05-15 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/90461
+ * io/open.c (new_unit): Don't check if the file is already open
+ for F2018.
+
2019-05-02 Jakub Jelinek <jakub@redhat.com>
* Makefile.am (gfor_cdir): Remove $(MULTISUBDIR).
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index b48afabf7a3..d3bb11f5965 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -515,7 +515,8 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags *flags)
Do not error if opening file preconnected to stdin, stdout, stderr. */
u2 = NULL;
- if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) != 0)
+ if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) != 0
+ && !(compile_options.allow_std & GFC_STD_F2018))
u2 = find_file (opp->file, opp->file_len);
if (u2 != NULL
&& (options.stdin_unit < 0 || u2->unit_number != options.stdin_unit)