PR fortran/45577
* resolve.c (resolve_allocate_expr): Do default initialization via
EXEC_INIT_ASSIGN.
2010-09-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/45577
* gfortran.dg/allocate_derived_4.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164305
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-09-15 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45577
+ * resolve.c (resolve_allocate_expr): Do default initialization via
+ EXEC_INIT_ASSIGN.
+
2010-09-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* mathbuiltins.def: Do not defined huge_val built-in.
if (ts.type == BT_CLASS)
ts = ts.u.derived->components->ts;
- if (ts.type == BT_DERIVED)
- {
- code->expr3 = gfc_default_initializer (&ts);
- gfc_resolve_expr (code->expr3);
+ if (ts.type == BT_DERIVED && gfc_has_default_initializer(ts.u.derived))
+ {
+ gfc_expr *init_e = gfc_default_initializer (&ts);
+ gfc_code *init_st = gfc_get_code ();
+ init_st->loc = code->loc;
+ init_st->op = EXEC_INIT_ASSIGN;
+ init_st->expr1 = gfc_expr_to_initialize (e);
+ init_st->expr2 = init_e;
+ init_st->next = code->next;
+ code->next = init_st;
}
}
else if (code->expr3->mold && code->expr3->ts.type == BT_DERIVED)
+2010-09-15 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45577
+ * gfortran.dg/allocate_derived_4.f90: New.
+
2010-09-15 Tejas Belagod <tejas.belagod@arm.com>
* lib/target-supports.exp
--- /dev/null
+! { dg-do compile }
+!
+! PR 45577: [4.6 Regression] Bogus(?) "... type incompatible with source-expr ..." error
+!
+! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr>
+
+program main
+
+type b_obj
+ integer,allocatable :: c(:)
+ real :: r = 5.
+end type b_obj
+
+type (b_obj),allocatable :: b(:)
+integer,allocatable :: c(:)
+
+allocate(b(3),c(3))
+
+end program main