[Bug fortran/96294] Compile error for pointer function
dominiq at lps dot ens.fr
gcc-bugzilla@gcc.gnu.org
Thu Jul 23 10:45:58 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96294
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
read
F2008: A pointer function assignment is ambiguous if it is the first executable
statement after the specification block. Please add any other kind of
executable statement before it. FIXME
program a
IMPLICIT NONE
print *, "begin"
myfunc() = 311
print*,myfunc()
contains
FUNCTION myfunc() RESULT (result_ptr)
IMPLICIT NONE
INTEGER, POINTER :: result_ptr
INTEGER, SAVE, TARGET:: targ
result_ptr => targ
END FUNCTION myfunc
end program a
gives
begin
311
More information about the Gcc-bugs
mailing list