[Bug fortran/56500] [OOP] "IMPLICIT CLASS(...)" wrongly rejected

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Mar 17 12:55:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56500

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-03-17
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2013-03-17 12:55:07 UTC ---
The following patch makes the example in comment 0 work:


Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c    (revision 196748)
+++ gcc/fortran/decl.c    (working copy)
@@ -6293,6 +6293,13 @@ attr_decl1 (void)
     }
     }

+  if (sym->ts.type == BT_UNKNOWN
+      && gfc_set_default_type (sym, 1, NULL) == FAILURE)
+    {
+      m = MATCH_ERROR;
+      goto cleanup;
+    }
+
   /* Update symbol table.  DIMENSION attribute is set in
      gfc_set_array_spec().  For CLASS variables, this must be applied
      to the first component, or '_data' field.  */



More information about the Gcc-bugs mailing list