re PR fortran/37336 ([F03] Finish derived-type finalization)
authorTobias Burnus <burnus@net-b.de>
Tue, 28 May 2013 18:30:03 +0000 (20:30 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 28 May 2013 18:30:03 +0000 (20:30 +0200)
2013-05-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37336
        * resolve.c (gfc_resolve_finalizers): Remove not implemented
        * error.

2013-05-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37336
        * gfortran.dg/finalize_11.f90: New.
        * gfortran.dg/finalize_4.f03: Remove dg-error.
        * gfortran.dg/finalize_5.f03: Ditto.
        * gfortran.dg/finalize_6.f03: Ditto.
        * gfortran.dg/finalize_7.f03: Ditto.

From-SVN: r199388

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/finalize_11.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_4.f03
gcc/testsuite/gfortran.dg/finalize_5.f03
gcc/testsuite/gfortran.dg/finalize_6.f90
gcc/testsuite/gfortran.dg/finalize_7.f03

index b9a4a6998df84e8e3e0862d82c35054ca8fa742b..326a01f0875c8e1e9625edda23c533fec0743a6f 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/37336
+       * resolve.c (gfc_resolve_finalizers): Remove not implemented error.
+
 2013-05-28  Tobias Burnus  <burnus@net-b.de>
 
        * trans-expr.c (gfc_conv_procedure_call): Deallocate
index 78a1038009b5157863c742e55d14f55f05653932..4cfc858b7c48262ff10884afeb4f675bac3b043c 100644 (file)
@@ -11241,10 +11241,6 @@ error:
                 " defined at %L, suggest also scalar one",
                 derived->name, &derived->declared_at);
 
-  /* TODO:  Remove this error when finalization is finished.  */
-  gfc_error ("Finalization at %L is not yet implemented",
-            &derived->declared_at);
-
   gfc_find_derived_vtab (derived);
   return result;
 }
index fa8802eb2e2e6499792fecb058571afce933d3e4..cbf3d3261497d216b7feeb9832e8bbdd9578b6d9 100644 (file)
@@ -1,3 +1,12 @@
+2013-05-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/37336
+       * gfortran.dg/finalize_11.f90: New.
+       * gfortran.dg/finalize_4.f03: Remove dg-error.
+       * gfortran.dg/finalize_5.f03: Ditto.
+       * gfortran.dg/finalize_6.f03: Ditto.
+       * gfortran.dg/finalize_7.f03: Ditto.
+
 2013-05-28  Tobias Burnus  <burnus@net-b.de>
 
        * gfortran.dg/class_array_16.f90: New.
diff --git a/gcc/testsuite/gfortran.dg/finalize_11.f90 b/gcc/testsuite/gfortran.dg/finalize_11.f90
new file mode 100644 (file)
index 0000000..e9bb814
--- /dev/null
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! Copied from finalize_6.f90 - was before rejected as the finalization
+! wrapper uses TS29913 (-std=f2008ts) features.
+!
+
+MODULE final_type
+  IMPLICIT NONE
+
+  TYPE :: mytype
+    INTEGER :: fooarr(42)
+    REAL :: foobar
+  CONTAINS
+    FINAL :: finalize_single
+  END TYPE mytype
+
+CONTAINS
+
+  SUBROUTINE finalize_single (el)
+    IMPLICIT NONE
+    TYPE(mytype) :: el
+    ! Do nothing in this test
+  END SUBROUTINE finalize_single
+
+END MODULE final_type
+
+PROGRAM finalizer
+  IMPLICIT NONE
+  ! Do nothing
+END PROGRAM finalizer
index 11e094f0d8f7522b79c9ec4de4f1086268359c70..b4c08f236da61044707ba14d496b56105d176671 100644 (file)
@@ -48,6 +48,3 @@ PROGRAM finalizer
   DEALLOCATE(mat)
 
 END PROGRAM finalizer
-
-! TODO: Remove this once finalization is implemented.
-! { dg-excess-errors "not yet implemented" }
index b9ec3768fe4b4903a87992ab9bdf1c8564df7958..fb8153140b7f568b7285df5b6fa3132e001f8951 100644 (file)
@@ -107,6 +107,3 @@ PROGRAM finalizer
   IMPLICIT NONE
   ! Nothing here, errors above
 END PROGRAM finalizer
-
-! TODO: Remove this once finalization is implemented.
-! { dg-excess-errors "not yet implemented" }
index 82d662f8c8d5b66694ec052a6aa0c6a09e0b58a8..d155c7bd0a504b693126547389948c388c2e7c6a 100644 (file)
@@ -10,9 +10,9 @@ MODULE final_type
   TYPE :: mytype
     INTEGER :: fooarr(42)
     REAL :: foobar
-  CONTAINS ! { dg-error "Fortran 2003" }
-    FINAL :: finalize_single ! { dg-error "Fortran 2003" }
-  END TYPE mytype
+  CONTAINS ! { dg-error "Fortran 2003: CONTAINS block in derived type definition" }
+    FINAL :: finalize_single ! { dg-error "Fortran 2003: FINAL procedure declaration|FINAL procedure 'finalize_single' at .1. is not a SUBROUTINE" }
+  END TYPE mytype ! { dg-error "Fortran 2008: Derived type definition at .1. with empty CONTAINS section" }
 
 CONTAINS
 
@@ -28,6 +28,3 @@ PROGRAM finalizer
   IMPLICIT NONE
   ! Do nothing
 END PROGRAM finalizer
-
-! TODO: Remove this once finalization is implemented.
-! { dg-excess-errors "not yet implemented" }
index 6ca4f55db7a61411dda7d64597014f3efc899b2c..5807ed50e15fd9bdd7637e963bc712828a133e1c 100644 (file)
@@ -52,6 +52,3 @@ PROGRAM finalizer
   IMPLICIT NONE
   ! Nothing here
 END PROGRAM finalizer
-
-! TODO: Remove this once finalization is implemented.
-! { dg-excess-errors "not yet implemented" }