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/47789] [OOP] Structure constructor of type extending DT with no components


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47789

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 #3 from janus at gcc dot gnu.org 2011-02-18 20:16:20 UTC ---
The following patch fixes it (not regtested):

Index: gcc/fortran/primary.c
===================================================================
--- gcc/fortran/primary.c       (revision 170270)
+++ gcc/fortran/primary.c       (working copy)
@@ -2310,6 +2310,12 @@ gfc_match_structure_constructor (gfc_symbol *sym,
        {
          gfc_component *this_comp = NULL;

+         if (comp == sym->components && sym->attr.extension
+             && comp->ts.type == BT_DERIVED
+             && comp->ts.u.derived->attr.zero_comp)
+           /* Skip empty parents.  */ 
+           comp = comp->next;
+
          if (!comp_head)
            comp_tail = comp_head = gfc_get_structure_ctor_component ();
          else


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