------- Comment #3 from burnus at gcc dot gnu dot org 2007-08-06 19:23 ------- Patch for the first part. Missing: Check for default initializer.
Index: resolve.c =================================================================== --- resolve.c (revision 127246) +++ resolve.c (working copy) @@ -610 +610 @@ resolve_common_blocks (gfc_symtree *comm - gfc_symbol *sym; + gfc_symbol *sym, *csym; @@ -618,0 +619,14 @@ resolve_common_blocks (gfc_symtree *comm + for (csym = symtree->n.common->head; csym; csym = csym->common_next) + { + printf("DEBUG '%s' - derived=%s?\n",csym->name, csym->ts.type == BT_DERIVED?"yes":"no"); + /* Derived type names must have the SEQUENCE attribute. */ + if (csym->ts.type == BT_DERIVED + && !(csym->ts.derived->attr.sequence + || csym->ts.derived->attr.is_bind_c)) + { + gfc_error ("Derived type variable '%s' in COMMON at %L has " + "neither the SEQUENCE nor the BIND(C) attribute", + csym->name, &csym->declared_at); + } + } + Index: match.c =================================================================== --- match.c (revision 127246) +++ match.c (working copy) @@ -2635,8 +2634,0 @@ gfc_match_common (void) - /* Derived type names must have the SEQUENCE attribute. */ - if (sym->ts.type == BT_DERIVED && !sym->ts.derived->attr.sequence) - { - gfc_error ("Derived type variable in COMMON at %C does not " - "have the SEQUENCE attribute"); - goto cleanup; - } - -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32985