On 9/18/25 2:10 AM, Paul Richard Thomas wrote:
Hi All,
The recent change of PDT constructors to allow "structure-constructor
is type-name [ ( type-param-spec-list ) ]( [ component-spec-list ] )"
missed the possibility that the (type-param-spec-list) is optional, if
default values are available. This patch permits this by looking for a
left hand bracket after the first list has been read. If present, the
full constructor is used. Otherwise, the actual arglist is tried as
the type_param_spec_list. If this does not match, a NULL
type-parameter-spec-list is used and gfc_get_pdt_instance will return
an error if any default values are missing.
The chunk in resolve.cc removes the default initialization of the
function itself, rather than the result, for the case of PDT functions
with an implicit result.
pdt_33.f03 needed a bit of a white space tidy up and the missed
deallocation in pdt_3.f03 was noted in the course of working up this
fix. Unfortunately, pdt_3.f03 still leaks memory (PR121972).
Regtests with FC42/x86_64. OK for mainline?
Paul
Hi Paul, looks good to me. Tests ok.
OK for mainline.
Thanks,
Jerry