Fortran: Fix regression in parameterized derived type handling
Fortran compiler corrects regression in parameterized derived type handling by adjusting symbol attribute access.
This commit addresses a regression in the Fortran compiler’s handling of parameterized derived types (PDTs), resolving issues related to parameter access. It updates symbol attribute access from CLASS_DATA (sym)->attr.pointer to CLASS_DATA (sym)->attr.class_pointer and removes unnecessary pointer attributes for dummies. This ensures correct internal representation and handling of PDTs, preventing compilation errors.
In Details
This patch for PR128876 in the Fortran front-end modifies gfc_trans_deferred_vars in trans-decl.cc. It corrects the erroneous use of CLASS_DATA (sym)->attr.pointer by replacing it with CLASS_DATA (sym)->attr.class_pointer and removing the pointer attribute for dummies. This aligns the internal representation with the correct handling of class objects via DECL_LANG_SPECIFIC declarations, specifically for parameterized derived types.
- PDT
- Parameterized Derived Type in Fortran. A derived type whose definition includes parameters that can be specified when the type is declared, allowing for more flexible and generic type definitions.
- declaration
- In programming, a declaration introduces a name and an entity (like a variable or function) to the compiler, specifying its type and other properties. It tells the compiler about the existence of something.