aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-02-18 23:34:34 +0100
committerJanus Weil <janus@gcc.gnu.org>2011-02-18 23:34:34 +0100
commit34c10b3bbde4bb401d78c8230bfce893e08f6dce (patch)
treeade38c5085e9549d56a88b49e9e81a2e8612d7bc /gcc/fortran/primary.c
parent56ee2f5a356d5e0067cb233c759315b1f6fa51ff (diff)
downloadgcc-34c10b3bbde4bb401d78c8230bfce893e08f6dce.zip
gcc-34c10b3bbde4bb401d78c8230bfce893e08f6dce.tar.gz
gcc-34c10b3bbde4bb401d78c8230bfce893e08f6dce.tar.bz2
re PR fortran/47789 ([F03] Structure constructor of type extending DT with no components)
2011-02-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47789 * primary.c (gfc_match_structure_constructor): Handle empty parent types. 2011-02-18 Janus Weil <janus@gcc.gnu.org> PR fortran/47789 * gfortran.dg/derived_constructor_comps_4.f90: New. From-SVN: r170291
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index c8e2bb6..4cda7a1 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2310,6 +2310,12 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result,
{
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