2012-01-29 Tobias Burnus <burnus@net-b.de>
PR fortran/41600
* expr.c (gfc_default_initializer): Convert the values if
the type does not match.
2012-01-29 Tobias Burnus <burnus@net-b.de>
PR fortran/41600
* gfortran.dg/default_initialization_6.f90: New.
Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
From-SVN: r183682
(write_blank_common): Call write_atom directly.
(write_symbol): Likewise.
+2012-01-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41600
+ * expr.c (gfc_default_initializer): Convert the values if
+ the type does not match.
+
2012-01-29 Tobias Burnus <burnus@net-b.de>
PR fortran/51972
PR fortran/50556
* symbol.c (check_conflict): namelist-group-name cannot have the SAVE
- attribure.
+ attribute.
2012-01-21 Tobias Burnus <burnus@net-b.de>
gfc_constructor *ctor = gfc_constructor_get();
if (comp->initializer)
- ctor->expr = gfc_copy_expr (comp->initializer);
+ {
+ ctor->expr = gfc_copy_expr (comp->initializer);
+ if ((comp->ts.type != comp->initializer->ts.type
+ || comp->ts.kind != comp->initializer->ts.kind)
+ && !comp->attr.pointer && !comp->attr.proc_pointer)
+ gfc_convert_type_warn (ctor->expr, &comp->ts, 2, false);
+ }
if (comp->attr.allocatable
|| (comp->ts.type == BT_CLASS && CLASS_DATA (comp)->attr.allocatable))
+2012-01-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41600
+ * gfortran.dg/default_initialization_6.f90: New.
+
2012-01-29 Tobias Burnus <burnus@net-b.de>
PR fortran/51972
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/41600
+!
+ implicit none
+ type t
+ integer :: X = -999.0
+ end type t
+ class(t), allocatable :: y(:)
+ allocate (t :: y(1))
+end