------- Comment #1 from burnus at gcc dot gnu dot org  2009-08-16 12:32 -------
Interpretation request has been answered, cf.
http://www.j3-fortran.org/doc/year/09/09-237r1.txt

The following program is invalid but accepted by gfortran:

  MODULE example
    INTERFACE f
      MODULE PROCEDURE f0,f
    END INTERFACE
  CONTAINS
    INTEGER FUNCTION f0(n) RESULT(y)
      y = n + 1
    END FUNCTION
    INTEGER FUNCTION f(n1,n2) RESULT(y2)
      y2 = f(n1+n2)
    END FUNCTION
  END MODULE

Expected: As NAG f95 prints:
Error: line 10: Invalid recursive self-reference to F

Or in other words: The "f" refers to the specific function.



>From the interpretation request:

Edits are supplied to correct the rules in 12.4.4 to account for
recursive self-references to functions with RESULT clauses.  The
function F should be established to be specific, and the reference
should be to itself.

EDITS:

[276:36+] Insert new case
  "(a2) if the scoping unit is a subprogram that defines a procedure
        with that name;"
{Establish the name to be (only) specific.}

[278:15+] Insert new case
  "(3a) If the scoping unit is a subprogram that defines a procedure
        with that name, the reference is to that procedure."
{Resolve to the procedure.}


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |NEW
   Last reconfirmed|2009-05-28 16:02:35         |2009-08-16 12:32:05
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40264

Reply via email to