]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/25068 ([4.0/4.1] IOSTAT should be default integer when -std=f95)
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>
Sat, 10 Dec 2005 21:44:43 +0000 (22:44 +0100)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 10 Dec 2005 21:44:43 +0000 (21:44 +0000)
PR fortran/25068

* io.c (resolve_tag): Add correct diagnostic for F2003 feature.

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

From-SVN: r108360

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

index e9a8f308dae0271a391856076bfffa2db0dd421b..ac80fd7392b6281d28fd4e10c96650966889f9e8 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 090f905ea30fdcdb93d00d9ad8d14281326b6319..6d3d94b7ffba4a5c5aa86ae4420c55343c600f99 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 8c170f041028e441ddd62388ec389b34f65a7907..1eb55cf1d4d91aedaf868f29327970031d9b8da1 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