[Bug fortran/23373] Functions returning pointers with pointer argument

rsandifo at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Sep 7 16:58:00 GMT 2005


------- Additional Comments From rsandifo at gcc dot gnu dot org  2005-09-07 16:58 -------
Hmm.  I supposed I'd better check.  Is the following code
also valid:

program main
  implicit none
  real, dimension (:), pointer :: x
  x => null()
  x => test ()
contains
  function test
    real, dimension (:), pointer :: test
    if (associated (x)) call abort
    allocate (test (10))
    if (associated (x)) call abort
  end function test
end program main

I've not read anything in the standard that forbids it, but I'd
appreciate it if more seasoned folks could comment.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23373



More information about the Gcc-bugs mailing list