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>
Sun, 9 Jan 2022 21:08:14 +0000 (22:08 +0100)
commit2e63128306ff93d8f53119137dd6c28b2defac94
tree948ad63e7807d7e3874dddb39ff9e15b6bc33641
parentc1c17a43e172ebc28f2cd247f6e83c5fdbc6219f
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.
gcc/fortran/expr.c
gcc/testsuite/gfortran.dg/pr101762.f90 [new file with mode: 0644]