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: Sun, 17 Mar 2013 12:55:07 +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
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. */