https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100218
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:5aee8c2a33ae0d3f375ed0ca6e03718b284d2574 commit r11-8308-g5aee8c2a33ae0d3f375ed0ca6e03718b284d2574 Author: Harald Anlauf <anl...@gmx.de> Date: Sat Apr 24 20:38:06 2021 +0200 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. (cherry picked from commit 32c4d970ea3a9fc330d6aa8fd83f9dae0b9afc64)