re PR fortran/20883 (unassigned integer used as format)
authorFeng Wang <fengwang@nudt.edu.cn>
Wed, 1 Jun 2005 03:44:43 +0000 (03:44 +0000)
committerFeng Wang <fengwang@gcc.gnu.org>
Wed, 1 Jun 2005 03:44:43 +0000 (03:44 +0000)
2005-06-01  Feng Wang  <fengwang@nudt.edu.cn>

        PR fortran/20883
        * fortran/io.c (resolve_tag): Fix error message.

2005-06-01  Feng Wang  <fengwang@nudt.edu.cn>

        PR fortran/20883
        * gfortran/assign_4.f90: New test.
        * gfortran/assign_2.f90: Change compile to run.

From-SVN: r100424

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

index 388e87eb02b60960e63be53fe89666a8ec533be4..af23e9f59efb527ab5c0ebcc66e85e5895d46e7f 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-01  Feng Wang  <fengwang@nudt.edu.cn>
+
+       PR fortran/20883
+       * fortran/io.c (resolve_tag): Fix error message.
+
 2005-05-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * fortran/trans-decl.c: Don't include errors.h.
index 7777f05a41008a0b2aef6286bccddf027dca2ed7..34619ab27dfe431c7b67a972a3afe25f3aae30e0 100644 (file)
@@ -974,8 +974,9 @@ resolve_tag (const io_tag * tag, gfc_expr * e)
       /* Format label can be integer varibale.  */
       if (tag != &tag_format || e->ts.type != BT_INTEGER)
         {
-          gfc_error ("%s tag at %L must be of type %s", tag->name, &e->where,
-                    gfc_basic_typename (tag->type));
+          gfc_error ("%s tag at %L must be of type %s or %s", tag->name,
+               &e->where, gfc_basic_typename (tag->type),
+               gfc_basic_typename (BT_INTEGER));
           return FAILURE;
         }
     }
index 5b5fce64d409db2729e8b06bea82666185133d6c..c9aa862c4e239bdaf58d1b2ce78ec54bdd8a764a 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-01  Feng Wang  <fengwang@nudt.edu.cn>
+
+       PR fortran/20883
+       * gfortran/assign_4.f90: New test.
+       * gfortran/assign_2.f90: Change compile to run.
+
 2005-05-31  Geoffrey Keating  <geoffk@geoffk.org>
 
        * lib/target-supports.exp 
index 4119cd94f58a60794eec5060b425e046811b8a44..6db1f2fe85ce42171fd603db45354e7dc9c0b871 100644 (file)
@@ -1,4 +1,4 @@
-! { dg-do compile }
+! { dg-do run }
 ! Option passed to avoid excess errors from obsolete warning
 ! { dg-options "-w" }
 ! PR18827
diff --git a/gcc/testsuite/gfortran.dg/assign_4.f90 b/gcc/testsuite/gfortran.dg/assign_4.f90
new file mode 100644 (file)
index 0000000..f958e98
--- /dev/null
@@ -0,0 +1,4 @@
+! { dg-do compile }
+! PR fortran/20883
+      write (*, a) b ! { dg-error "must be of type CHARACTER or INTEGER" }
+      end