]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: reject invalid non-constant pointer initialization targets
authorHarald Anlauf <anlauf@gmx.de>
Sun, 9 Jan 2022 21:08:14 +0000 (22:08 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Tue, 25 Jan 2022 19:24:50 +0000 (20:24 +0100)
commita5f7e0838e1573f4cc33a6f2c70c60187d7a63af
tree4c1ffe606c7c7688a4ebea4947f617da20926706
parent21551a4af1be07d7b98221639ec1bd18106c1f80
Fortran: reject invalid non-constant pointer initialization targets

gcc/fortran/ChangeLog:

PR fortran/101762
* expr.c (gfc_check_pointer_assign): For pointer initialization
targets, check that subscripts and substring indices in
specifications are constant expressions.

gcc/testsuite/ChangeLog:

PR fortran/101762
* gfortran.dg/pr101762.f90: New test.

(cherry picked from commit 2e63128306ff93d8f53119137dd6c28b2defac94)
gcc/fortran/expr.c
gcc/testsuite/gfortran.dg/pr101762.f90 [new file with mode: 0644]