re PR fortran/41581 ([OOP] Allocation of a CLASS with SOURCE=<class> does not work)
authorJanus Weil <janus@gcc.gnu.org>
Tue, 13 Oct 2009 16:12:24 +0000 (18:12 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Tue, 13 Oct 2009 16:12:24 +0000 (18:12 +0200)
commitf43085aaa3fef8263b4afc1c2b5f9721d9bdd8b2
tree0ad66bf731ba1ac3e83d8ded18791c03cb46d62a
parentb9e467a24acb203f5a087721a74943a3af67f16a
re PR fortran/41581 ([OOP] Allocation of a CLASS with SOURCE=<class> does not work)

2009-10-13  Janus Weil  <janus@gcc.gnu.org>

PR fortran/41581
* decl.c (encapsulate_class_symbol): Add new component '$size'.
* resolve.c (resolve_allocate_expr): Move CLASS handling to
gfc_trans_allocate.
(resolve_class_assign): Replaced by gfc_trans_class_assign.
(resolve_code): Remove calls to resolve_class_assign.
* trans.c (gfc_trans_code): Use new function gfc_trans_class_assign.
* trans-expr.c (get_proc_ptr_comp): Fix a memory leak.
(gfc_conv_procedure_call): For CLASS dummies, set the
$size component.
(gfc_trans_class_assign): New function, replacing resolve_class_assign.
* trans-stmt.h (gfc_trans_class_assign): New prototype.
* trans-stmt.c (gfc_trans_allocate): Use correct size when allocating
CLASS variables. Do proper initialization. Move some code here from
resolve_allocate_expr.

2009-10-13  Janus Weil  <janus@gcc.gnu.org>

PR fortran/41581
* gfortran.dg/class_allocate_2.f03: Modified.
* gfortran.dg/class_allocate_3.f03: New test case.

From-SVN: r152715
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/resolve.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans-stmt.h
gcc/fortran/trans.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/class_allocate_2.f03
gcc/testsuite/gfortran.dg/class_allocate_3.f03 [new file with mode: 0644]