+2011-10-07 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50625
+ * class.c (gfc_build_class_symbol): Fix whitespace.
+ * module.c (mio_symbol): Set 'class_ok' attribute.
+ * trans-decl.c (gfc_get_symbol_decl): Make sure the backend_decl has
+ been built for class symbols.
+
2011-10-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/35831
/* Class container has already been built. */
return SUCCESS;
- attr->class_ok = attr->dummy || attr->pointer || attr->allocatable;
+ attr->class_ok = attr->dummy || attr->pointer || attr->allocatable;
if (!attr->class_ok)
/* We can not build the class container yet. */
mio_symbol_attribute (&sym->attr);
mio_typespec (&sym->ts);
+ if (sym->ts.type == BT_CLASS)
+ sym->attr.class_ok = 1;
if (iomode == IO_OUTPUT)
mio_namespace_ref (&sym->formal_ns);
{
gfc_component *c = CLASS_DATA (sym);
if (!c->ts.u.derived->backend_decl)
- gfc_find_derived_vtab (c->ts.u.derived);
+ {
+ gfc_find_derived_vtab (c->ts.u.derived);
+ gfc_get_derived_type (sym->ts.u.derived);
+ }
}
/* All deferred character length procedures need to retain the backend
+2011-10-07 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/50625
+ * gfortran.dg/class_46.f03: New.
+
2011-10-06 Joern Rennecke <joern.rennecke@embecosm.com>
* gcc.dg/pr47276.c (ASMNAME, ASMNAME2, STRING): Define.
--- /dev/null
+! { dg-do run }
+!
+! PR 50625: [4.6/4.7 Regression][OOP] ALLOCATABLE attribute lost for module CLASS variables
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module m
+type t
+end type t
+class(t), allocatable :: x
+end module m
+
+use m
+implicit none
+if (allocated(x)) call abort()
+end
+
+! { dg-final { cleanup-modules "m" } }