The ASSOCIATED statement with function argument is rejected by gfortran. ifort, g95, pgf90, pathf90, sunf90, xlf90 all happily accept the (somewhat silly) program below with expected results?
Regards, Juha program test real, pointer :: a allocate(a) print*,associated( x(a) ) contains function x(a) RESULT(b) real, pointer :: a,b b => a end function x end program test gfortran -v -o ptrf ptrf.f90 Driving: gfortran -v -o ptrf ptrf.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc Using built-in specs. Target: i386-linux Configured with: ../gcc/configure --prefix=/tmp/gfortran-20051205/irun --enable-languages=c,fortran --host=i386-linux Thread model: posix gcc version 4.2.0 20051205 (experimental) /home/wrk/jpr/irun/bin/../libexec/gcc/i386-linux/4.2.0/f951 ptrf.f90 -quiet -dumpbase ptrf.f90 -auxbase ptrf -version -o /tmp/ccZ3fGqg.s GNU F95 version 4.2.0 20051205 (experimental) (i386-linux) compiled by GNU C version 4.0.2 (Debian 4.0.2-2). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 In file ptrf.f90:5 print*,associated( x(a) ) 1 Error: 'pointer' argument of 'associated' intrinsic at (1) must be a variable -- Summary: ASSOCIATED( func() ) rejected ? Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jpr at csc dot fi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25292