Fortran: Fix errors related to parameterized derived types
Corrected errors in Fortran's handling of parameterized derived types, ensuring correct allocation of components with explicit parameters.
This commit addresses issues in GCC’s Fortran front-end concerning parameterized derived types (PDTs). When recursing into PDT components, the compiler now correctly verifies that all components of the parameter list are explicit before allocating parameterized components. If they are not explicit, the components’ own parameter lists are used to replace assumed expressions, resolving errors reported in PR82173.
In Details
The structure_alloc_comps function in trans-array.cc was failing to correctly handle parameterized derived types (PDTs) when their components were not fully specified. This patch modifies the function to ensure that during recursion into PDT components, it checks for explicit parameters. If parameters are not explicit, it now uses the component's own parameter list to resolve assumed expressions, fixing bugs related to PDT instantiation and allocation as reported in PR82173.
- parameterized derived type
- A derived type in Fortran whose definition includes parameters that must be specified when the type is declared. These parameters can influence the type's structure or behavior.
- PR82173
- A bug report identifier within the GCC bug tracking system, referencing a specific issue reported by a user. This commit directly addresses the problem described in PR82173.