This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47789] [OOP] Structure constructor of type extending DT with no components
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 Feb 2011 20:16:43 +0000
- Subject: [Bug fortran/47789] [OOP] Structure constructor of type extending DT with no components
- Auto-submitted: auto-generated
- References: <bug-47789-4@http.gcc.gnu.org/bugzilla/>
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