]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: checking of pointer targets for structure constructors [PR56423]
authorHarald Anlauf <anlauf@gmx.de>
Mon, 10 Feb 2025 17:47:45 +0000 (18:47 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Mon, 10 Feb 2025 17:47:45 +0000 (18:47 +0100)
commit118a6c3247bb30ef932341cec3ca15e2c6304b69
tree7e555722abc99a7c7407b2b5da56b8ecfc44711f
parent4ce8ad684b90606a74f0cccfd9455184046c6c4e
Fortran: checking of pointer targets for structure constructors [PR56423]

Check the target of a pointer component in a structure constructor for same
ranks, and that the initial-data-target does not have vector subscripts.

PR fortran/56423

gcc/fortran/ChangeLog:

* resolve.cc (resolve_structure_cons): Check rank of pointer target;
reject pointer target with vector subscripts.

gcc/testsuite/ChangeLog:

* gfortran.dg/derived_constructor_comps_2.f90: Adjust test.
* gfortran.dg/derived_constructor_comps_8.f90: New test.
gcc/fortran/resolve.cc
gcc/testsuite/gfortran.dg/derived_constructor_comps_2.f90
gcc/testsuite/gfortran.dg/derived_constructor_comps_8.f90 [new file with mode: 0644]