]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add finalizer creation to array constructor for functions of derived type.
authorAndre Vehreschild <vehre@gcc.gnu.org>
Thu, 27 Jul 2023 12:51:34 +0000 (14:51 +0200)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Fri, 7 Jun 2024 08:54:03 +0000 (10:54 +0200)
commitc3190756487080a11e819746f00b6e30fd0a0c2e
tree6f8e5456e96bb8e709e448d49c4da1eef3e8dbec
parenta47b1aaa7a76201da7e091d9f8d4488105786274
Add finalizer creation to array constructor for functions of derived type.

PR fortran/90068

gcc/fortran/ChangeLog:

* trans-array.cc (gfc_trans_array_ctor_element): Eval non-
variable expressions once only.
(gfc_trans_array_constructor_value): Add statements of
final block.
(trans_array_constructor): Detect when final block is required.

gcc/testsuite/ChangeLog:

* gfortran.dg/finalize_57.f90: New test.
gcc/fortran/trans-array.cc
gcc/testsuite/gfortran.dg/finalize_57.f90 [new file with mode: 0644]