This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/56500] [OOP] "IMPLICIT CLASS(...)" wrongly rejected
- 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: Mon, 18 Mar 2013 12:56:57 +0000
- Subject: [Bug fortran/56500] [OOP] "IMPLICIT CLASS(...)" wrongly rejected
- Auto-submitted: auto-generated
- References: <bug-56500-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56500
--- Comment #10 from janus at gcc dot gnu.org 2013-03-18 12:56:57 UTC ---
(In reply to comment #9)
> > Yes. I hope this variant should work better (regtesting now):
>
> It "works better", but still has regressions:
Yes, I already noticed this. The following version should finally be
regression-free:
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 196748)
+++ gcc/fortran/decl.c (working copy)
@@ -6293,6 +6293,10 @@ attr_decl1 (void)
}
}
+ if (sym->ts.type == BT_UNKNOWN
+ && gfc_get_default_type (sym->name, NULL)->type == BT_CLASS)
+ gfc_set_default_type (sym, 0, NULL);
+
/* 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. */