re PR fortran/49112 ([OOP] Missing type-bound procedure, "duplicate save" warnings...
authorJanus Weil <janus@gcc.gnu.org>
Tue, 21 Jun 2011 12:12:51 +0000 (14:12 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Tue, 21 Jun 2011 12:12:51 +0000 (14:12 +0200)
2011-06-21  Janus Weil  <janus@gcc.gnu.org>

PR fortran/49112
* class.c (gfc_find_derived_vtab): Make vtab and default initialization
symbols SAVE_IMPLICIT.

2011-06-21  Janus Weil  <janus@gcc.gnu.org>

PR fortran/49112
* gfortran.dg/class_44.f03: New.

From-SVN: r175257

gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/class_44.f03 [new file with mode: 0644]

index 2e73625d927c66835bc1d91b3dae58402e0d63de..7d45cd45c4df2c25a614af8ec08df1f68ca61a95 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-21  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/49112
+       * class.c (gfc_find_derived_vtab): Make vtab and default initialization
+       symbols SAVE_IMPLICIT.
+
 2011-06-20  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/18918
index b99930ab63304791df2c6f9a88d1794a5e034af7..572011f45f6af951a54bb13fa711fda3086699bc 100644 (file)
@@ -428,7 +428,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
                              &gfc_current_locus) == FAILURE)
            goto cleanup;
          vtab->attr.target = 1;
-         vtab->attr.save = SAVE_EXPLICIT;
+         vtab->attr.save = SAVE_IMPLICIT;
          vtab->attr.vtab = 1;
          vtab->attr.access = ACCESS_PUBLIC;
          gfc_set_sym_referenced (vtab);
@@ -516,7 +516,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
                  sprintf (name, "__def_init_%s", tname);
                  gfc_get_symbol (name, ns, &def_init);
                  def_init->attr.target = 1;
-                 def_init->attr.save = SAVE_EXPLICIT;
+                 def_init->attr.save = SAVE_IMPLICIT;
                  def_init->attr.access = ACCESS_PUBLIC;
                  def_init->attr.flavor = FL_VARIABLE;
                  gfc_set_sym_referenced (def_init);
index a615950bf00c218c167be3c6ac30882d45296c22..1415426df9f8350b8b7e5f067320913015526948 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-21  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/49112
+       * gfortran.dg/class_44.f03: New.
+
 2011-06-21  Ira Rosen  <ira.rosen@linaro.org>
 
        PR tree-optimization/49478
diff --git a/gcc/testsuite/gfortran.dg/class_44.f03 b/gcc/testsuite/gfortran.dg/class_44.f03
new file mode 100644 (file)
index 0000000..f8e4004
--- /dev/null
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! PR 49112: [4.6/4.7 Regression] [OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error
+!
+! Contributed by John <jwmwalrus@gmail.com>
+
+    implicit none
+    save
+
+    type :: DateTime
+    end type
+
+    class(DateTime), allocatable :: dt
+
+end