Fortran - allow target of pointer from evaluation of function-reference
authorHarald Anlauf <anlauf@gmx.de>
Sat, 24 Apr 2021 18:38:06 +0000 (20:38 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sat, 24 Apr 2021 18:39:14 +0000 (20:39 +0200)
commit32c4d970ea3a9fc330d6aa8fd83f9dae0b9afc64
tree7867cd89d0b0c7451755945496cb74b1cd23b6c6
parenta1765b421eb3d01ecc88fb0cdec9f06bfdaab8e2
Fortran - allow target of pointer from evaluation of function-reference

Fortran allows the target of a pointer from the evaluation of a
function-reference in a variable definition context (e.g. F2018:R902).

gcc/fortran/ChangeLog:

PR fortran/100218
* expr.c (gfc_check_vardef_context): Extend check to allow pointer
from a function reference.

gcc/testsuite/ChangeLog:

PR fortran/100218
* gfortran.dg/ptr-func-4.f90: New test.
gcc/fortran/expr.c
gcc/testsuite/gfortran.dg/ptr-func-4.f90 [new file with mode: 0644]