https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120140
--- Comment #23 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:73022dea028fd509615dfeb130c0b0abb853080e commit r16-8569-g73022dea028fd509615dfeb130c0b0abb853080e Author: Harald Anlauf <[email protected]> Date: Fri Apr 10 23:01:49 2026 +0200 Fortran: defined assignment and vector subscripts [PR120140] Fortran allows array sections with vector subscripts as actual arguments to elemental procedures (e.g. F2023: 15.5.2.5): (21) If the procedure is nonelemental, the dummy argument does not have the VALUE attribute, and the actual argument is an array section having a vector subscript, the dummy argument is not definable and shall not have the ASYNCHRONOUS, INTENT (OUT), INTENT (INOUT), or VOLATILE attributes. Adjust the checking accordingly to allow vector subscripts in defined assignment. PR fortran/120140 gcc/fortran/ChangeLog: * dependency.cc (gfc_check_argument_var_dependency): For elemental subroutines skip the dependency check for array references. Correct description of function return value. * interface.cc (gfc_compare_actual_formal): Allow array sections with vector subscripts as actual arguments to elemental procedures in accordance with the Fortran standard. gcc/testsuite/ChangeLog: * gfortran.dg/defined_assignment_13.f90: New test. Co-authored-by: Mikael Morin <[email protected]>
