Commit cb44ab82 by Victor Leikehman Committed by Paul Brook

decl.c (variable_decl): Always apply default initializer.

fortran/
	* decl.c (variable_decl): Always apply default initializer.
libgfortran/
	* gfortran.fortran-torture/execute/def_init_3.f90: New test.

From-SVN: r81865
parent 15f8ac7f
2004-05-14 Victor Leikehman <lei@haifasphere.co.il>
* decl.c (variable_decl): Always apply default initializer.
2004-05-08 Tobias Schlter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/15206
......
......@@ -619,10 +619,11 @@ variable_decl (void)
if (m != MATCH_YES)
goto cleanup;
}
else if (current_ts.type == BT_DERIVED)
{
initializer = default_initializer ();
}
}
if (current_ts.type == BT_DERIVED && !initializer)
{
initializer = default_initializer ();
}
/* Add the initializer. Note that it is fine if &initializer is
......
2004-05-14 Victor Leikehman <lei@haifasphere.co.il>
* gfortran.fortran-torture/execute/def_init_3.f90: New test.
2004-05-14 Jeff Law <law@redhat.com>
* gcc.dg/tree-ssa/20040514-2.c: New test.
......
! PR15365
! Default initializers were being missed
program main
type xyz
integer :: x = 123
end
type (xyz) :: a !! ok
type (xyz) b !!! not initialized !!!
if (a%x.ne.123) call abort
if (b%x.ne.123) 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