------- Additional Comments From tkoenig at gcc dot gnu dot org 2005-09-18
19:50 -------
Not fixed in 4.0:
$ cat pointer_function.f90
program Realloc
IMPLICIT NONE
REAL, DIMENSION(:), POINTER :: x
INTEGER :: i
x => NULL()
x => myallocate(x)
contains
FUNCTION myallocate(p)
REAL, DIMENSION(:), POINTER :: p, myallocate
INTEGER :: nold,ierr
if (associated(p)) then
print *,"p is associated"
else
print *,"p is not associated"
end if
allocate(myallocate(20))
if (associated(p)) then
print *,"p is associated"
else
print *,"p is not associated"
end if
END FUNCTION myallocate
end program Realloc
$ gfortran pointer_function.f90
$ ./a.out
p is not associated
p is associated
$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0/configure --prefix=/home/ig25
--enable-languages=c,fortran
Thread model: posix
gcc version 4.0.2 20050917 (prerelease)
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Known to fail| |4.0.2
Known to work| |4.1.0
Resolution|FIXED |
Summary|Functions returning pointers|[4.0 only] Functions
|with pointer argument |returning pointers with
| |pointer argument
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23373