http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47767
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org |gnu.org | --- Comment #2 from janus at gcc dot gnu.org 2011-02-16 21:58:12 UTC --- Ok, I think what we need to do is basically to make sure that vtab/vtype symbols are always public and are not affected by PRIVATE statements. Here is a first patch: Index: gcc/fortran/module.c =================================================================== --- gcc/fortran/module.c (revision 170222) +++ gcc/fortran/module.c (working copy) @@ -4874,7 +4874,8 @@ write_symbol0 (gfc_symtree *st) && !sym->attr.subroutine && !sym->attr.function) dont_write = true; - if (!gfc_check_access (sym->attr.access, sym->ns->default_access)) + if (!sym->attr.vtab && !sym->attr.vtype + && !gfc_check_access (sym->attr.access, sym->ns->default_access)) dont_write = true; if (!dont_write) @@ -4982,7 +4983,8 @@ write_symtree (gfc_symtree *st) && sym->ns->proc_name->attr.if_source == IFSRC_IFBODY) return; - if (!gfc_check_access (sym->attr.access, sym->ns->default_access) + if ((!sym->attr.vtab && !sym->attr.vtype + && !gfc_check_access (sym->attr.access, sym->ns->default_access)) || (sym->attr.flavor == FL_PROCEDURE && sym->attr.generic && !sym->attr.subroutine && !sym->attr.function)) return; This fixes the test case, but is not regtested yet.