This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40054] [F08] Pointer functions as lvalue
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 3 Jul 2011 11:33:18 +0000
- Subject: [Bug fortran/40054] [F08] Pointer functions as lvalue
- Auto-submitted: auto-generated
- References: <bug-40054-4@http.gcc.gnu.org/bugzilla/>
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)