Commit 34c10b3b by Janus Weil

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
parent 56ee2f5a
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 Tobias Burnus
PR fortran/47775
......
......@@ -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
......
2011-02-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/47789
* gfortran.dg/derived_constructor_comps_4.f90: New.
2011-02-18 Tobias Burnus
PR fortran/47775
......
! { dg-do run }
!
! PR 47789: [F03] Structure constructor of type extending DT with no components
!
! Contributed by eddyg_61-bugzilla@yahoo.it
type:: one
end type
type, extends(one) :: two
integer :: a
end type
type(two) :: wo = two(6)
if (wo%a /= 6) call abort()
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment