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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Harald Anlauf
<anl...@gcc.gnu.org>:

https://gcc.gnu.org/g:0d4862691d2b58f7bd2d58de0e78bc574c313d39

commit r13-8592-g0d4862691d2b58f7bd2d58de0e78bc574c313d39
Author: Harald Anlauf <anl...@gmx.de>
Date:   Wed Mar 27 21:18:04 2024 +0100

    Fortran: fix DATA and derived types with pointer components [PR114474]

    When matching actual arguments in match_actual_arg, these are initially
    treated as a possible dummy procedure, assuming that the correct type is
    determined later.  This resolution could fail when the procedure is a
    derived type constructor with a pointer component and appears in a DATA
    statement, where the pointer shall be associated with an initial data
    target.  Check for those cases where the type obviously has not been
    resolved yet, and which were missed because there was no component
    reference.

    gcc/fortran/ChangeLog:

            PR fortran/114474
            * primary.cc (gfc_variable_attr): Catch variables used in structure
            constructors within DATA statements that are still tagged with a
            temporary type BT_PROCEDURE from match_actual_arg and which have
the
            target attribute, and fix their typespec.

    gcc/testsuite/ChangeLog:

            PR fortran/114474
            * gfortran.dg/data_pointer_3.f90: New test.

    (cherry picked from commit bbb7c513dddc5c9b2d5e9b78bc1c2f85a0cfe07e)

Reply via email to