This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50625] [4.6/4.7 Regression][OOP] ALLOCATABLE attribute lost for module CLASS variables
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 05 Oct 2011 21:42:33 +0000
- Subject: [Bug fortran/50625] [4.6/4.7 Regression][OOP] ALLOCATABLE attribute lost for module CLASS variables
- Auto-submitted: auto-generated
- References: <bug-50625-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50625
--- Comment #2 from janus at gcc dot gnu.org 2011-10-05 21:42:33 UTC ---
Here's an attempt to fix it:
Index: module.c
===================================================================
--- module.c (revision 179566)
+++ module.c (working copy)
@@ -3608,6 +3608,8 @@ mio_symbol (gfc_symbol *sym)
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);
A similar thing is already being done for components (cf. 'mio_component').
However, with this patch, the test case gives me a different error:
internal compiler error: in gfc_conv_component_ref, at fortran/trans-expr.c:529