The following was commited to fix the reported regression. Thank you Jürgen Reuter for the report and the bi-section.

Regards,

Jerry

---

The master branch has been updated by Jerry DeLisle <[email protected]>:

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

commit r17-6639-gb21ccc7c211e6a4a5e77f20fd05d65c378f583df
Author: Jerry DeLisle <[email protected]>
Date:   Tue Nov 24 09:17:21 2026 -0800

    fortran: [PR128976] Bogus INTENT(IN) error for a POINTER selector

    Since the fix for PR54322, defining the associate name of a CLASS IS
    block whose selector is a POINTER dummy with INTENT(IN) was rejected,
    although only a nonpointer INTENT(IN) object is barred from a variable
    definition context (F2023 C846).  The INTENT(IN) check asked whether the
    associate name was a pointer rather than the dummy argument, and that
    was true only while the associate name had the POINTER attribute of its
    class container.  Check the dummy argument instead.  This also fixes the
    same bogus error for an element of a polymorphic POINTER INTENT(IN)
    array.

    Assisted-by: Claude Opus 5.5

            PR fortran/128976

    gcc/fortran/ChangeLog:

            * expr.cc (gfc_check_vardef_context): For INTENT(IN), test the
            POINTER attribute of the dummy argument, which for a SELECT TYPE
            temporary is the selector.

    gcc/testsuite/ChangeLog:

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

Reply via email to