This series of patches makes use of an ingenious idea of Jerry
Delisle's, which is to use Claude to peruse the fortran 2023 standard,
concerning Parameterized Derived Types, and generate a testsuite to
test both function and constraints. Even better is the generation of
reducers to exercise the errors found with gfortran. These tests are
to be found attached to comment #10 of PR82173.

There are 3 subdirectories:

~/pos/*.f90 testing the functioning of PDTs;
~/neg/*.f90 testing the constraints; and
~/reproducers/bug*.f90 to test fixes for the bugs found in the first
two subdirectories.

bug1-simplify-len-ice.f90                       patch 1/16
bug2-inquiry-kind.f90                            fixed in mainline but
not gcc-16
bug3-allocate-star-ice.f90                     also PR82649 - patch
13/16 reserved
bug4-dealloc-scope-exit.f90                  patch 2/16
bug5-lower-bound-double-free.f90        patch 3/16
bug6-alloc-self-component-ice.f90        patch 4/16
bug7-parent-default-init.f90                   patch 5/16
bug8-ctor-keyword-order.f90                 fixed in mainline but not gcc-16
bug9-class-is-kind-ice.f90                      patch 6/16
bug10-unlimited-poly-alloc-len.f90         patch 6/16
bug11-class-dummy-extension-len.f90  patch 7/16
bug12-intent-out-default-init.f90             patch 8/16
bug13-proc-ptr-comp-init-ice.f90            patch 9/16
bug14-bogus-deferred-param-error.f90  patch 10/16
bug15-allocate-len-error-condition.f90   fix not yet implemented -
patch 14/16 reserved
bug16-mold-loses-len.f90                      patch 11/16
bug17-final-rank-overload-ice.f90          patch 4/16
bug18-namelist-pdt-ice.f90                    patch 12/16
bug19-storage-size.f90                          spurious
bug20-cshift-double-free.f90                  fix not yet implemented
- patch 15/16 reserved
bug21-assumed-dummy-corrupts-inherited-param.f90   patch 7/16
bug22-import-pdt-ice.f90                        patch 5/16
bug23-submodule-pdt-result.f90            patch 11/16
bug24-omp-private-pdt.f90                    16-branch fails in MAIN__._omp_fn.0
                                                               version
`GOMP_6.0.2' not found for mainline
                                                               I have
reserved the last patch for this test.

It should be noted that there are plenty of compile and runtime time
checks being missed; eg. bug15 but also some variants of bug10. For
example. the invalid, reduced version:
module m2
  type :: base(k, n)
    integer, kind :: k = 4
    integer, len :: n ! no initializer
    real(k) :: v(n)
  end type
end module
program i2
  use m2
  class(*), allocatable :: u
  allocate (base(4, *) :: u)  ! Assumed 'n'
! select type construct excised
end program

Segfaults at run time. This will be fixed when I turn to bug 15;

In the long term, it would be good to replace gfortran.dg/pdt*.f03
with the tests, suitably concatenated, in ~/pos and ~/neg. However, I
would wish to give them a very good check for copyright violations.

Reply via email to