[Bug fortran/60232] [OOP] The rank of the element in the structure constructor does not match that of the component
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 18 21:21:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60232
--- Comment #3 from janus at gcc dot gnu.org ---
I think this patch is even better:
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 207846)
+++ gcc/fortran/expr.c (working copy)
@@ -3962,9 +3962,10 @@ gfc_get_variable_expr (gfc_symtree *var)
e->symtree = var;
e->ts = var->n.sym->ts;
- if ((var->n.sym->as != NULL && var->n.sym->ts.type != BT_CLASS)
- || (var->n.sym->ts.type == BT_CLASS && CLASS_DATA (var->n.sym)
- && CLASS_DATA (var->n.sym)->as))
+ if (var->n.sym->attr.flavor != FL_PROCEDURE
+ && ((var->n.sym->as != NULL && var->n.sym->ts.type != BT_CLASS)
+ || (var->n.sym->ts.type == BT_CLASS && CLASS_DATA (var->n.sym)
+ && CLASS_DATA (var->n.sym)->as)))
{
e->rank = var->n.sym->ts.type == BT_CLASS
? CLASS_DATA (var->n.sym)->as->rank : var->n.sym->as->rank;
More information about the Gcc-bugs
mailing list