https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93175
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Paul Thomas <[email protected]>: https://gcc.gnu.org/g:39961581f247660c451018563f1407c614a19bd8 commit r16-4282-g39961581f247660c451018563f1407c614a19bd8 Author: Paul Thomas <[email protected]> Date: Wed Oct 8 08:17:10 2025 +0100 Fortran: Fix PDT parameter substitution [PR93175,PR102240,PR102686] 2025-10-08 Paul Thomas <[email protected]> gcc/fortran PR fortran/93175 PR fortran/102240 PR fortran/102686 * array.cc (match_array_element_spec): For pdt templates, call gfc_correct_parm_expr to elimante extraneous symbols from the bound expressions. * decl.cc (correct_parm_expr, gfc_correct_parm_expr): New fcns that remove symbols that are not PDT parameters from the type specification expressions. (insert_parameter_exprs): Process function symbols as if they are variables in the substitution with parameter expressions. (gfc_get_pdt_instance): Make sure that the parameter list of PDT components is updated as the instance is built. Move the construction of pdt_strings down a bit in the function and remove the tie up with pdt_arrays. * gfortran.h: Add prototype for gfc_correct_parm_expr. * resolve.cc (resolve_component): Skip testing for constant specification expressions in pdt_template component string lengths and pdt_strings. * trans-array.cc (structure_alloc_comps): Remove testing for deferred parameters and instead make sure that components of PDT type have parameters substituted with the parameter exprs of the enclosing PDT. gcc/testsuite/ PR fortran/93175 PR fortran/102240 PR fortran/102686 * gfortran.dg/pdt_55.f03: New test.
