https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122766
--- Comment #4 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:77f4a4f4d17726492960a582e57c781dc89f15bb commit r16-5542-g77f4a4f4d17726492960a582e57c781dc89f15bb Author: Paul Thomas <[email protected]> Date: Mon Nov 24 11:30:19 2025 +0000 Fortran: Failure with 1st PDT example in F2018 standard [PR122766] 2025-11-24 Paul Thomas <[email protected]> gcc/fortran PR fortran/122766 * decl.cc (gfc_match_decl_type_spec): A pdt_type found while parsing a contains section can only arise from the typespec of a function declaration. This can be retained in the typespec. Once we are parsing the function, the first reference to this derived type will find that it has no symtree. Provide it with one so that gfc_use_derived does not complain and, again,retain it in the typespec. gcc/testsuite PR fortran/122766 * gfortran.dg/pdt_69.f03: New test.
