[Bug fortran/60952] [F03] Problem using "end" as a type bound procedure and contained procedures

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 12 22:50:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60952

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Problem using "end" as a    |[F03] Problem using "end"
                   |type bound procedure and    |as a type bound procedure
                   |contained procedures        |and contained procedures

--- Comment #2 from janus at gcc dot gnu.org ---
Here is another variant which is rejected with the same error:


module m
  implicit none

  type A
  contains
    procedure, nopass :: e => end
  end type

contains

  subroutine s1
  contains
    subroutine s2
    end
  end

  integer function end()
  end

end


Here is what I suspect is happening:
1) After parsing the type declaration, we know that there's a symbol called
'end'.
2) During the parsing of the two subroutines, it somehow happens that the
symbol 'end' is wrongly identified as a variable.
3) When parsing the function, we get an error due to the conflict of the
VARIABLE and PROCEDURE attributes.


The first thing we need to find out is how exactly 'end' obtains the attribute
VARIABLE.


More information about the Gcc-bugs mailing list