From: Janus Weil Date: Tue, 21 Jun 2011 12:12:51 +0000 (+0200) Subject: re PR fortran/49112 ([OOP] Missing type-bound procedure, "duplicate save" warnings... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=95f5c7757f027c4c9afbb97a7a24be0cc9ad7841;p=gcc.git re PR fortran/49112 ([OOP] Missing type-bound procedure, "duplicate save" warnings and internal compiler error) 2011-06-21 Janus Weil PR fortran/49112 * class.c (gfc_find_derived_vtab): Make vtab and default initialization symbols SAVE_IMPLICIT. 2011-06-21 Janus Weil PR fortran/49112 * gfortran.dg/class_44.f03: New. From-SVN: r175257 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2e73625d927..7d45cd45c4d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-06-21 Janus Weil + + PR fortran/49112 + * class.c (gfc_find_derived_vtab): Make vtab and default initialization + symbols SAVE_IMPLICIT. + 2011-06-20 Tobias Burnus PR fortran/18918 diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index b99930ab633..572011f45f6 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a615950bf00..1415426df9f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-21 Janus Weil + + PR fortran/49112 + * gfortran.dg/class_44.f03: New. + 2011-06-21 Ira Rosen 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 index 00000000000..f8e4004c026 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_44.f03 @@ -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 + + implicit none + save + + type :: DateTime + end type + + class(DateTime), allocatable :: dt + +end