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

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

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

commit r15-9845-gf34f1b1d6c451604645e2e42cf57b876f3d955df
Author: Harald Anlauf <anl...@gmx.de>
Date:   Sun Jun 15 21:09:28 2025 +0200

    Fortran: fix checking of MOLD= in ALLOCATE statements [PR51961]

    In ALLOCATE statements where the MOLD= argument is present and is not
    scalar, and the allocate-object has an explicit-shape-spec, the standard
    does not require the ranks to agree.  In that case we skip the rank check,
    but emit a warning if -Wsurprising is given.

            PR fortran/51961

    gcc/fortran/ChangeLog:

            * resolve.cc (conformable_arrays): Use modified rank check when
            MOLD= expression is given.

    gcc/testsuite/ChangeLog:

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

    (cherry picked from commit 3b276fe0d22f9052657dbbffbb8ad6f8585bd304)

Reply via email to