http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50550
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
--- Comment #3 from janus at gcc dot gnu.org ---
Here is a simple patch to accept the code in comment 0:
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 200258)
+++ gcc/fortran/decl.c (working copy)
@@ -1197,6 +1197,9 @@ build_sym (const char *name, gfc_charlen *cl, bool
sym->attr.implied_index = 0;
+ /* Update current_attr with merged symbol attributes. */
+ current_attr = sym->attr;
+
if (sym->ts.type == BT_CLASS)
return gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
For cases like the one in comment 1, more work is required (which probably
involves moving the corresponding check to resolution stage). Provided it is
valid at all.