PR fortran/25068
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Dec 2005 21:44:43 +0000 (21:44 +0000)
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Dec 2005 21:44:43 +0000 (21:44 +0000)
* io.c (resolve_tag): Add correct diagnostic for F2003 feature.

* gfortran.dg/iostat_3.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108360 138bc75d-0d04-0410-961f-82ee72b054a4

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

index e9a8f30..ac80fd7 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-10  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/25068
+       * io.c (resolve_tag): Add correct diagnostic for F2003 feature.
+
 2005-12-10  Thomas Koenig  <Thomas.Koenig@online.de>
 
        PR fortran/23815
index 090f905..6d3d94b 100644 (file)
@@ -1046,12 +1046,22 @@ resolve_tag (const io_tag * tag, gfc_expr * e)
          gfc_error ("%s tag at %L must be scalar", tag->name, &e->where);
          return FAILURE;
        }
+
       if (tag == &tag_iomsg)
        {
          if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: IOMSG tag at %L",
                              &e->where) == FAILURE)
            return FAILURE;
        }
+
+      if (tag == &tag_iostat && e->ts.kind != gfc_default_integer_kind)
+       {
+         if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Non-default "
+                             "integer kind in IOSTAT tag at %L",
+                             &e->where) == FAILURE)
+           return FAILURE;
+       }
+
       if (tag == &tag_convert)
        {
          if (gfc_notify_std (GFC_STD_GNU, "Extension: CONVERT tag at %L",
index 8c170f0..1eb55cf 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-10  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR fortran/25068
+       * gfortran.dg/iostat_3.f90: New test.
+
 2005-12-10  Thomas Koenig  <Thomas.Koenig@online.de>
 
        PR fortran/23815
diff --git a/gcc/testsuite/gfortran.dg/iostat_3.f90 b/gcc/testsuite/gfortran.dg/iostat_3.f90
new file mode 100644 (file)
index 0000000..db9547b
--- /dev/null
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! Testcase for PR libfortran/25068
+  real :: u
+  integer(kind=8) :: i
+  open (10,status="scratch")
+  read (10,*,iostat=i) u ! { dg-warning "Fortran 2003: Non-default integer kind in IOSTAT tag" }
+  close (10,iostat=i) ! { dg-warning "Fortran 2003: Non-default integer kind in IOSTAT tag" }
+  end