]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Implement PDT constructors with syntax variants [PR114815]
authorPaul Thomas <pault@gcc.gnu.org>
Thu, 18 Sep 2025 18:00:08 +0000 (19:00 +0100)
committerPaul Thomas <pault@gcc.gnu.org>
Thu, 18 Sep 2025 18:00:08 +0000 (19:00 +0100)
commitc52c745c98f846308ad18a6d49da541cebb0a8b3
treeb1b0e487bc85aef1a28bb2dae43438d964992444
parent642504b41cee46cf06aaa391386108563739a80c
Fortran: Implement PDT constructors with syntax variants [PR114815]

2025-09-18  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/114815
* decl.cc (gfc_get_pdt_instance): Copy the contents of 'tb' and
not the pointer.
* primary.cc (gfc_match_rvalue): If there is only one actual
argument list, use if for the type spec parameter values. If
this fails try the default type specification values and use
the actual arguments for the component values.
* resolve.cc (build_init_assign): Don't initialize implicit PDT
function results.

gcc/testsuite/
PR fortran/114815
* gfortran.dg/pdt_3.f03: Add missing deallocation of 'matrix'.
* gfortran.dg/pdt_17.f03: Change dg-error text.
* gfortran.dg/pdt_47.f03: New test.
gcc/fortran/decl.cc
gcc/fortran/primary.cc
gcc/fortran/resolve.cc
gcc/testsuite/gfortran.dg/pdt_17.f03
gcc/testsuite/gfortran.dg/pdt_3.f03
gcc/testsuite/gfortran.dg/pdt_47.f03 [new file with mode: 0644]