This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Fortran, Patch] PR 33917 - PROCEDURE(proc-interface) - ensure proc-interface is resolved
- From: Tobias Burnus <burnus at net-b dot de>
- To: Janus Weil <jaydub66 at googlemail dot com>
- Cc: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 28 Oct 2007 19:26:32 +0100
- Subject: Re: [Fortran, Patch] PR 33917 - PROCEDURE(proc-interface) - ensure proc-interface is resolved
- References: <47235A87.7060703@net-b.de> <854832d40710280513v2e8fe4c5x7926b5d6d188861@mail.gmail.com>
Hi Janus,
Janus Weil wrote:
> Nevertheless I'd like to propose two changes:
>
> 1) I think those two lines you added should go into resolve.c
> (resolve_symbol), to make sure this also works when the lines in the
> example are exchanged to:
> procedure(p4) :: p6
> procedure(sub) :: p4
> This case would still give an error with your patch.
>
The question is whether that code is valid or not.
While g95 accept it, NAG f95 rejects it with:
Error: proc_decl_5.f90, line 17: P4 used as proc-interface before its
declaration
With my patch it is also rejected, with yours it is accepted.
As I could not find it in the standard, I asked at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/2eea7b997482aa5e/
Note: The second program in c.l.f is rejected by gfortran, but accepted
by NAG f95. I think it is valid, but see what will be consensus on c.l.f.
> 2) The "if" should become a "while", to make it work for deeper nesting, as in:
> procedure(sub) :: p4
> procedure(p4) :: p6
> procedure(p6) :: p8
>
I think "while" is not needed if one puts it in decl.c, but for
resolve.c one needs "while".
Tobias