This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/42545] type extension: parent component has wrong accessibility



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]