This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42545] type extension: parent component has wrong accessibility
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2010 23:34:51 -0000
- Subject: [Bug fortran/42545] type extension: parent component has wrong accessibility
- References: <bug-42545-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from janus at gcc dot gnu dot org 2010-01-17 23:34 -------
Here is a simple patch for setting the parent component accessibility:
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 155994)
+++ gcc/fortran/decl.c (working copy)
@@ -6931,6 +6931,7 @@ gfc_match_derived_decl (void)
p->ts.type = BT_DERIVED;
p->ts.u.derived = extended;
p->initializer = gfc_default_initializer (&p->ts);
+ p->attr.access = extended->attr.access;
/* Set extension level. */
if (extended->attr.extension == 255)
This is probably not enough, since the access. specification of the parent type
may come after the daughter type definition. But this already fixes the exmple
in comment #2.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42545