Fortran: Fix inherited PDT parameter namespaces [PR104750]
Fortran module handling corrected for inherited parameter namespaces in derived types.
GCC’s Fortran front-end has fixed an issue related to how inherited parameter namespaces are handled for derived types, specifically addressing PR104750. The fix ensures that when modules containing derived types with parameters are read, the correct symbol information and references are loaded. This prevents namespace conflicts and ensures that parameter namespaces are properly transferred or managed, especially for locally declared parameters within derived types.
In Details
This commit resolves PR fortran/104750 by correcting the handling of inherited parameter namespaces for user-defined type (PDT) specification parameters in Fortran modules. The changes in module.cc refine mio_full_f2k_derived, read_cleanup, and introduce fixup_pdt_parameter_namespaces. Instead of naively transferring sym_root, mio_f2k_derived is called to ensure full symbol and reference loading. read_cleanup now restores named symtree entries for referenced PDT parameters, and fixup_pdt_parameter_namespaces correctly transfers local parameter namespaces to the derived-type na…
- Fortran
- A high-level programming language commonly used for scientific and numerical computation.
- derived type
- A user-defined data type in Fortran that can aggregate variables of different types, similar to a 'struct' in C or 'class' in C++.
- PDT
- Parameter-Derived Type. This likely refers to a derived type in Fortran whose definition includes parameters, allowing for parameterized generic programming.
- namespace
- A region or scope within a program where names (like variables or types) are uniquely defined and can be accessed. In Fortran modules, namespaces help prevent naming conflicts.
- module
- A Fortran construct used for program modularity, allowing code and data to be grouped and shared between program units. Modules also have their own namespaces.
- sym_root
- Likely refers to the root symbol table entry or node in the compiler's internal representation for a given symbol or scope.
- PR
- Problem Report. A number assigned to a bug or issue reported in the GCC bug tracking system.