]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/20842 (can't use 'END=' in output statement)
authorFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sun, 3 Jul 2005 01:46:12 +0000 (01:46 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sun, 3 Jul 2005 01:46:12 +0000 (01:46 +0000)
PR fortran/20842
* io.c (match_dt_element): Do not allow END tag in PRINT or
WRITE statement.
* gfortran.dg/io_invalid_1.f90: New test.

From-SVN: r101545

gcc/fortran/ChangeLog
gcc/fortran/io.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/io_invalid_1.f90 [new file with mode: 0644]

index 55ba5ed0393a86dca82e78db63ed298020ebf4b4..6750a13189eaabd91a3802e3bf5340f306469208 100644 (file)
@@ -1,13 +1,20 @@
+2005-07-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/20842
+       * io.c (match_dt_element): Do not allow END tag in PRINT or
+       WRITE statement.
+
 2005-07-02  Joseph S. Myers  <joseph@codesourcery.com>
 
        * lang.opt: Remove "." from end of help texts.
 
 2005-07-01  Jerry DeLisle  <jvdelisle@verizon.net>
 
-    * gfortran.texi: Fix typos and grammar.
-    * invoke.texi: Fix typos and grammar.
-    * intrinsic.texi: Add documentaion for eoshift, epsilon, etime, and exit.
-    Fixed alignment of text for dtime syntax. Fixed a few line lengths.
+       * gfortran.texi: Fix typos and grammar.
+       * invoke.texi: Fix typos and grammar.
+       * intrinsic.texi: Add documentaion for eoshift, epsilon, etime, and
+       exit. Fixed alignment of text for dtime syntax. Fixed a few line
+       lengths.
 
 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
 
index c5ceb06582b1e2955427bf2db7c416dc6bb4e7fe..ef51308ab3219008455ee1e004cf6f546a1e018b 100644 (file)
@@ -1643,7 +1643,14 @@ match_dt_element (io_kind k, gfc_dt * dt)
 
   m = match_ltag (&tag_end, &dt->end);
   if (m == MATCH_YES)
-    dt->end_where = gfc_current_locus;
+    {
+      if (k == M_WRITE)
+       {
+         gfc_error ("END tag at %C not allowed in output statement");
+         return MATCH_ERROR;
+       }
+      dt->end_where = gfc_current_locus;
+    }
   if (m != MATCH_NO)
     return m;
 
index 5d94b114862f5a6dd74e6abf81292958d1242f8d..203bd56cc53d4d9db1cd4bb19c0b22bb2f406fb7 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/20842
+       * gfortran.dg/io_invalid_1.f90: New test.
+
 2005-07-03  Joseph S. Myers  <joseph@codesourcery.com>
 
        * gcc.dg/format/gcc_diag-1.c: Update.
diff --git a/gcc/testsuite/gfortran.dg/io_invalid_1.f90 b/gcc/testsuite/gfortran.dg/io_invalid_1.f90
new file mode 100644 (file)
index 0000000..75a528b
--- /dev/null
@@ -0,0 +1,5 @@
+! { dg-do compile }
+! PR fortran/20842
+WRITE(UNIT=6,END=999) 0 ! { dg-error "END tag .* is not compatible with output" }
+999 CONTINUE
+END