]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Check PDT parameters are of integer type [PR84432, PR114815]
authorPaul Thomas <pault@gcc.gnu.org>
Fri, 5 Sep 2025 06:22:01 +0000 (07:22 +0100)
committerPaul Thomas <pault@gcc.gnu.org>
Fri, 5 Sep 2025 06:22:01 +0000 (07:22 +0100)
commit6b6a2d461bfd3c81cc35c9989b225845681357cb
tree7acd920c1e72ee7c408e0edb61403feecc746e27
parent86353186dc2e477fa00df0edbaa389d338c2935c
Fortran: Check PDT parameters are of integer type [PR84432, PR114815]

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

gcc/fortran
PR fortran/84432
PR fortran/114815
* expr.cc (gfc_check_assign_symbol): Check that components in a
PDT with a default initializer have type and length parameters
that reduce to constant integer expressions.
* trans-expr.cc (gfc_trans_assignment_1): Parameterized
components cannot have default initializers so they must be
allocated after initialization.

gcc/testsuite/
PR fortran/84432
PR fortran/114815
* gfortran.dg/pdt_26.f03: Update with default no initializer.
* gfortran.dg/pdt_27.f03: Change to test non-conforming
initializers.
gcc/fortran/expr.cc
gcc/fortran/trans-expr.cc
gcc/testsuite/gfortran.dg/pdt_26.f03
gcc/testsuite/gfortran.dg/pdt_27.f03