]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Check constant PDT type specification parameters [PR112460]
authorPaul Thomas <pault@gcc.gnu.org>
Tue, 13 Jan 2026 08:19:05 +0000 (08:19 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Tue, 13 Jan 2026 08:19:05 +0000 (08:19 +0000)
commitfdfb0452237d10afd3488b08ec84237a1f4e7bff
treeb731c63d8441b4f6a8287c1fd39d4e1ed4260e36
parent47d09318c411911408058de38bebc16a177fa8e1
Fortran: Check constant PDT type specification parameters [PR112460]

2026-01-14  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/112460
* array.cc (resolve_array_list): Stash the first PDT element
and check its type specification parameters against those of
subsequent elements.
* expr.cc (get_parm_list_from_expr): New function to extract the
type spec lists from expressions to be compared.
(gfc_check_type_spec_parms): New function to compare type spec
lists between two expressions. Emit an error if any constant
values are different.
(gfc_check_assign): Check that the PDT type specification parms
are the same on lhs and rhs.
* gfortran.h : Add prototype for gfc_check_type_spec_parms.
* trans-expr.cc (copyable_array_p): PDT arrays are not copyable

gcc/testsuite
PR fortran/112460
* gfortran.dg/pdt_81.f03: New test.
gcc/fortran/array.cc
gcc/fortran/expr.cc
gcc/fortran/gfortran.h
gcc/fortran/trans-expr.cc
gcc/testsuite/gfortran.dg/pdt_81.f03 [new file with mode: 0644]