According to the following passage of the Fortran 2003 standard, statement functions and internal functions are forbidden in procedure pointer assignments:
C727 (R742) A procedure-name shall be the name of an external, module, or dummy procedure, a specific intrinsic function listed in 13.6 and not marked with a bullet (â¢), or a procedure pointer. Test cases: f(x) = x**2 procedure(), pointer :: p p => f print *, p(4.0) end ********** procedure(), pointer :: p p => sub contains subroutine sub end subroutine sub end ********** Internal functions, however, are valid in Fortran 2008. Thanks to Tobias for reporting this. -- Summary: Procedure Pointer Assignments: Statement Functions & Internal Functions Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: janus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39998