On 8/27/25 3:00 AM, Paul Richard Thomas wrote:
This patch corrects the form of PDT constructors so that they are
standard conforming:
structure-constructor is type-name [ ( type-param-spec-list ) ]
( [ component-spec-list ] )
At present, the type-param-spec-list for PDTs is rolled into the
component-spec-list. The patch separates the type-param-spec-list in the
chunk in primary.cc.
The chunks in decl.cc and trans-array.cc implement default
initialization for PDT components that are not type parameters or
parameterized components. Array component default initialization will
await the change of PDT representation needed to fix PR82649. This
change requires some experimentation as to how best to do it but is high
on my TODO list. Finally, the chunk in trans-io.cc suppresses the output
of type parameters.
The changes needed in pdt_22.f03, pdt_23.f03 and pdt_03.f03 are
sufficient but the testcase in the PR does now compile and run correctly.
With the patch applied, gfortran behaves in the same way as the other
brands and regtestsĀ on FC42/x86_64. OK for mainline?
Regards
Paul
This one is OK as well. Also two minor nits on comments, see below.
Thanks again for the patch!
Regards,
Jerry
+ gfortran representation this rather awkward because the two are not
>>>>>>>> ^ is
+ /* Generate this instance using the type parameters using the
+ first argument list and return the parameter list in
+ ctr_arglist. */
^^^ This needs some word engineering, maybe:
/* Generate this instance using the type parameters from the
first argument list and return the parameter list in
ctr_arglist. */