Hi Harald, > > I had only a quick glance at your patch. I guess you unintentionally > forgot to remove those parts that you already committed for PR110987, > along with the finalize-testcases. > Guilty as charged. I guess I got out of the wrong side of the bed :-) > > I am still trying to find the precise paragraph in the standard > you refer to regarding INTENT(OUT) and default initialization. > Page 114 of the draft F2023 standard: "The INTENT (OUT) attribute for a nonpointer dummy argument specifies that the dummy argument becomes undefined on invocation of the procedure, except for any subcomponents that are default-initialized (7.5.4.6)." With the fix, gfortran behaves in the same way as ifort and nagfor. On rereading the patch, I think that s/"and use the passed value"/"and leave undefined"/ or some such is in order. > While at it, I think I found a minor nit in testcase pr112407a.f90: > component x%i appears undefined the first time it is printed. > Fixed - thanks for pointing it out. A correct patch is attached. Thanks for looking at the previous, overloaded version. Paul > > > 2024-03-30 Paul Thomas > > > > gcc/fortran > > PR fortran/112407 > > *resolve.cc (resolve_procedure_expression): Change the test for > > for recursion in the case of hidden procedures from modules. > > (resolve_typebound_static): Add warning for possible recursive > > calls to typebound procedures. > > * trans-expr.cc (gfc_trans_class_init_assign): Do not apply > > default initializer to class dummy where component initializers > > are all null. > > > > gcc/testsuite/ > > PR fortran/112407 > > * gfortran.dg/pr112407a.f90: New test. > > * gfortran.dg/pr112407b.f90: New test. > > > >