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

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

https://gcc.gnu.org/g:18e49f19f5907de8d28cd33a8789946a3f5092ce

commit r16-3462-g18e49f19f5907de8d28cd33a8789946a3f5092ce
Author: Harald Anlauf <anl...@gmx.de>
Date:   Thu Aug 28 22:07:10 2025 +0200

    Fortran: improve compile-time checking of character dummy arguments
[PR93330]

            PR fortran/93330

    gcc/fortran/ChangeLog:

            * interface.cc (get_sym_storage_size): Add argument size_known to
            indicate that the storage size could be successfully determined.
            (get_expr_storage_size): Likewise.
            (gfc_compare_actual_formal): Use them to handle zero-sized dummy
            and actual arguments.
            If a character formal argument has the pointer or allocatable
            attribute, or is an array that is not assumed or explicit size,
            we generate an error by default unless -std=legacy is specified,
            which falls back to just giving a warning.
            If -Wcharacter-truncation is given, warn on a character actual
            argument longer than the dummy.  Generate an error for too short
            scalar character arguments if -std=f* is given instead of just a
            warning.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/argument_checking_15.f90: Adjust dg-pattern.
            * gfortran.dg/bounds_check_strlen_7.f90: Add dg-pattern.
            * gfortran.dg/char_length_3.f90: Adjust options.
            * gfortran.dg/whole_file_24.f90: Add dg-pattern.
            * gfortran.dg/whole_file_29.f90: Likewise.
            * gfortran.dg/argument_checking_27.f90: New test.

Reply via email to