[Bug fortran/110877] Incorrect copy of allocatable component in polymorphic assignment from array dummy argument

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 12 00:32:51 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110877

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jerry DeLisle <jvdelisle@gcc.gnu.org>:

https://gcc.gnu.org/g:b018656f8c016d1880d57ee79266cdecf98f41fa

commit r16-8017-gb018656f8c016d1880d57ee79266cdecf98f41fa
Author: Christopher Albert <albert@tugraz.at>
Date:   Tue Mar 10 22:39:54 2026 +0100

    Fortran: Fix class dummy-array assignment deep copy [PR110877]

    Recover the class vptr for scalarized elements of nonpointer
    dummy arrays so polymorphic assignment uses the deep-copy path.

            PR fortran/110877

    gcc/fortran/ChangeLog:

            * trans-expr.cc (gfc_trans_assignment_1): Recover the class
            vptr for scalarized elements of nonpointer dummy arrays.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/pr110877.f90: New test.

    Signed-off-by: Christopher Albert <albert@tugraz.at>


More information about the Gcc-bugs mailing list