This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch,gfortran] PR 21625: Initialization of derived types at allocation


:ADDPATCH fortran:

Here's a patch for PR 21625.  Allocatable/pointer variables of
derived types with initialized components were not initialized at
allocation.  This patch adds code to resolve.c/
resolve_allocate_expr() to insert an initialization statement
after the allocation statement.

Bubblestrapped and reg. tested on Linux/x86.  Please commit if
OK.


        Erik



2005-10-18  Erik Edelmann  <erik.edelmann@iki.fi>

        PR fortran/21625
        * resolve.c (expr_to_initialize): New function.
          (resolve_allocate_expr): Take current statement as new
          argument. Add default initializers to variables of
          derived types, if they need it.  (resolve_code):
          Provide current statement as argument to
          resolve_allocate_expr().



2005-10-18  Erik Edelmann  <erik.edelmann@iki.fi>

        PR fortran/21625
        * gfortran.fg/der_init_1.f90: New.

Attachment: 21625.diff
Description: Text document

Attachment: der_init_1.f90
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]