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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <[email protected]>:

https://gcc.gnu.org/g:47bb24546297ef6812d69bc800ec005fc7e567e9

commit r17-988-g47bb24546297ef6812d69bc800ec005fc7e567e9
Author: Harald Anlauf <[email protected]>
Date:   Thu May 28 22:49:26 2026 +0200

    Fortran: checking of passed character length [PR125393]

    Commit r16-3462 enhanced checking of character length passed to a character
    dummy.  However, when the actual argument was an array element, its storage
    size was estimated from all elements up to the end of the array.  This
    could give a bogus warning when the dummy argument was of a scalar
    character type.  Fix check for this case to actually compare the character
    lengths of actual and dummy.

            PR fortran/125393

    gcc/fortran/ChangeLog:

            * interface.cc (get_expr_storage_size): Additionally return
            character length.
            (gfc_compare_actual_formal): When the formal is a scalar character
            variable, use character lengths, not array storage size for check.

    gcc/testsuite/ChangeLog:

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

Reply via email to