This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/50625] [4.6/4.7 Regression][OOP] ALLOCATABLE attribute lost for module CLASS variables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]