This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran, Patch] PR 33917 - PROCEDURE(proc-interface) - ensure proc-interface is resolved


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]