http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40054
--- Comment #6 from janus at gcc dot gnu.org 2011-07-03 11:32:42 UTC --- (In reply to comment #2) > > two() = 7 > contains > function two () > integer, pointer :: two > allocate(two) > end function two > end > > Fails with: > > function two () > 1 > two() = 7 > 2 > Error: Procedure 'two' at (1) is already defined at (2) Huh. Since "two() = 7" is in fact a valid statement function declaration, gfortran might even be right to reject this, right? However, the following (valid?) variant is currently rejected: print *,"hello" two() = 7 contains function two () integer, pointer :: two allocate(two) end function two end two() = 7 1 Error: Unexpected STATEMENT FUNCTION statement at (1)