[Bug fortran/55199] [OOP] Equivalenced variable has wrong type when used with generic member function
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Nov 4 13:56:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55199
--- Comment #5 from janus at gcc dot gnu.org 2012-11-04 13:56:03 UTC ---
Here is an improved patch, which hopefully should be free of testsuite
regressions (will re-check):
Index: gcc/fortran/parse.c
===================================================================
--- gcc/fortran/parse.c (revision 193133)
+++ gcc/fortran/parse.c (working copy)
@@ -3395,12 +3395,10 @@ parse_associate (void)
sym->declared_at = a->where;
gfc_set_sym_referenced (sym);
- /* Initialize the typespec. It is not available in all cases,
- however, as it may only be set on the target during resolution.
- Still, sometimes it helps to have it right now -- especially
- for parsing component references on the associate-name
- in case of association to a derived-type. */
- sym->ts = a->target->ts;
+ /* For variables, we can already set the typespec. Other cases have to
+ wait until resolution stage. */
+ if (a->target->expr_type == EXPR_VARIABLE)
+ sym->ts = a->target->ts;
}
accept_statement (ST_ASSOCIATE);
More information about the Gcc-bugs
mailing list