re PR fortran/66643 (Missing compilation error for formatted data transfer without...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 30 Sep 2016 23:19:58 +0000 (23:19 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 30 Sep 2016 23:19:58 +0000 (23:19 +0000)
2016-09-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/66643
* io.c (match_dt_unit): Peek check for missing format.

* gfortran.fortran-torture/compile/arrayio.f90: Update test.
* gfortran.fortran-torture/compile/write.f90: Update test.

From-SVN: r240686

gcc/fortran/ChangeLog
gcc/fortran/io.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/compile/arrayio.f90
gcc/testsuite/gfortran.fortran-torture/compile/write.f90

index 19349a1a82b27901b08b82ed419fd06978dd355b..e3097249af4d60807057d4f7de67f4ec623df415 100644 (file)
@@ -1,3 +1,8 @@
+2016-09-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/66643
+       * io.c (match_dt_unit): Peek check for missing format.
+
 2016-09-30  Fritz Reese  <fritzoreese@gmail.com>
 
        PR fortran/77764
index 48c15ef55f9bfbb63b0b49ce16e55792a10c0773..7c48c491eeb630200548ee871525a60ba9155475 100644 (file)
@@ -2688,6 +2688,7 @@ static match
 match_dt_unit (io_kind k, gfc_dt *dt)
 {
   gfc_expr *e;
+  char c;
 
   if (gfc_match_char ('*') == MATCH_YES)
     {
@@ -2695,6 +2696,11 @@ match_dt_unit (io_kind k, gfc_dt *dt)
        goto conflict;
 
       dt->io_unit = default_unit (k);
+
+      c = gfc_peek_ascii_char ();
+      if (c == ')')
+       gfc_error_now ("Missing format with default unit at %C");
+
       return MATCH_YES;
     }
 
index 93f72c329748395aa546e6dad1c48a4af3d2dbe2..01a18526be32d2385921e70773d14f8cb313982b 100644 (file)
@@ -1,3 +1,9 @@
+2016-09-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/66643
+       * gfortran.fortran-torture/compile/arrayio.f90: Update test.
+       * gfortran.fortran-torture/compile/write.f90: Update test.
+
 2016-09-30  Matthew Wawhab  <matthew.wahab@arm.com>
 
        * gcc.target/arm/fp16-aapcs-3.c: Replace arm_fp16_ok with
index 1eec0bb59ce395e5af0cdfee872be3c61fce1c2e..8c333d437d292d3d11bb9641d3ad4dd9f572dd24 100644 (file)
@@ -8,5 +8,5 @@ program arrayio
       a(:, j) = (/ (i + (j - 1) * 5, i=1,5) /)
    end do
 
-   write (*) a
+   write (*,*) a
 end program
index 50b83cc6a1248331cf8baef4ba3a06968852b386..82ca8be4bdd4bb69c43ec989bead7facf43be6a7 100644 (file)
@@ -1,5 +1,5 @@
 ! Program to test simple IO
 program testwrite
-   write (*) 1
-   write (*) "Hello World"
+   write (*,*) 1
+   write (*,*) "Hello World"
 end program