This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/60952] [F03] Problem using "end" as a type bound procedure and contained procedures
- 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: Sat, 12 Nov 2016 22:50:04 +0000
- Subject: [Bug fortran/60952] [F03] Problem using "end" as a type bound procedure and contained procedures
- Auto-submitted: auto-generated
- References: <bug-60952-4@http.gcc.gnu.org/bugzilla/>
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.