diff options
author | Janus Weil <janus@gcc.gnu.org> | 2010-09-30 21:54:08 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2010-09-30 21:54:08 +0200 |
commit | 03d79dc39456d034c9b789d520c4f6161b0ecde6 (patch) | |
tree | 9a15f0e1b8c5bfeda7ddae4433988c820a4f0c88 /gcc/fortran | |
parent | 78009d9f6e4a5f16591682bd1d9c2d3f2e774863 (diff) | |
download | gcc-03d79dc39456d034c9b789d520c4f6161b0ecde6.zip gcc-03d79dc39456d034c9b789d520c4f6161b0ecde6.tar.gz gcc-03d79dc39456d034c9b789d520c4f6161b0ecde6.tar.bz2 |
re PR fortran/45828 (No default initialization of derived type members?)
2010-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/45828
* resolve.c (resolve_allocate_expr): Do not use
'gfc_has_default_initializer'.
2010-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/45828
* gfortran.dg/allocate_derived_5.f90: New.
From-SVN: r164765
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 74a87f7..b618e7d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-09-30 Janus Weil <janus@gcc.gnu.org> + + PR fortran/45828 + * resolve.c (resolve_allocate_expr): Do not use + 'gfc_has_default_initializer'. + 2010-09-30 Tobias Burnus <burnus@net-b.de> * gfortran.tex (Fortran 2008 status): Update list of diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4958cbd..60de8e5 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6708,6 +6708,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code) { /* Set up default initializer if needed. */ gfc_typespec ts; + gfc_expr *init_e; if (code->ext.alloc.ts.type == BT_DERIVED) ts = code->ext.alloc.ts; @@ -6717,9 +6718,8 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code) if (ts.type == BT_CLASS) ts = ts.u.derived->components->ts; - if (ts.type == BT_DERIVED && gfc_has_default_initializer(ts.u.derived)) + if (ts.type == BT_DERIVED && (init_e = gfc_default_initializer (&ts))) { - 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; |