https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107659
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkoenig at gcc dot gnu.org Keywords|rejects-valid |needs-stdcheck Status|NEW |WAITING --- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- (In reply to urbanjost from comment #0) > gfortran -c xbug.f90 > xbug.f90:42:27: > > 13 | function c_remove(c_path) bind(c,name="remove") result(c_err) > | 2 > ...... > 42 | call remove(self%key) > | 1 > Error: Global binding name ‘remove’ at (1) is already being used as a > FUNCTION at (2) Hmm... I believe this is code is invalid, and gfortran is right in issuing the error. According to F2023, 19.2, Global identifiers, the binding label "remove" is a global identifier, as is the name of an external procedure which you call (without a prototype or importing it from a module) as call remove(self%key) Also, "The global identifier of an entity shall not be the same as the global identifier of any other entity. Furthermore, a binding label shall not be the same as the global identifier of any other global entity, ignoring differences in case." Comments?