Fortran: [PDT] () Parameterized derived type errors [PR82173]
Fixes several errors related to Parameterized Derived Types (PDTs) in Fortran, improving type resolution and allocation.
This commit addresses multiple issues related to Parameterized Derived Types (PDTs) in the Fortran front-end, specifically concerning the resolution of type parameters and the allocation of components. Changes include correctly transferring interface result parameters to procedure symbols, ensuring parameters are copied to the final procedure symbol, and accurately transferring parameters to explicit results. It also fixes the allocation of parameterized components for deferred-variable scenarios and when a PDT MOLD expression is a variable.
In Details
This patch resolves several bugs in the Fortran front-end's handling of Parameterized Derived Types (PDTs), tracked under PR82173. Key fixes involve: decl.cc's get_proc_name and gfc_match_submod_proc now correctly stash and copy interface result parameters to the final procedure symbol; resolve.cc's resolve_pdt transfers parameters to the explicit result; and trans-decl.cc and trans-stmt.cc ensure correct allocation of parameterized components using param_list for deferred variables and MOLD expressions.
- Fortran
- A high-level programming language commonly used for scientific and engineering applications.
- PDT
- Parameterized Derived Type. A derived type in Fortran whose structure or components depend on type parameters provided at instantiation.
- type parameter
- A named value that can influence the structure or behavior of a derived type in Fortran.
- derived type
- A user-defined composite data type in Fortran, similar to a struct or class in other languages.
- interface
- In Fortran, an entity that specifies the properties of a procedure, such as its name, arguments, and return type, without providing the implementation.
- PR82173
- Problem Report number 82173, indicating a bug filed against the Fortran compiler.