The code
------------------------
MODULE test
TYPE vertex
INTEGER :: k
END TYPE vertex
CONTAINS
SUBROUTINE S1()
TYPE(vertex) :: a
vertex : DO i=1,2
ENDDO vertex
END SUBROUTINE
END MODULE test
------------------------
is invalid Fortran code, but
gfortran -std=f2003 -c -W -Wall label.f90
accepts it without any error or warning.
Short reasoning (by Richard Main):
"Both ["type(vertex)", label "vertex:"] are class 1 local identifiers.
Actually, almost everything is a class 1 local identifier.
See the list of them in c16.
You can't have 2 different class 1 entities with the same identifier"
See for the longer discussion:
http://groups.google.com/group/comp.lang.fortran/browse_frm/thread/a869ba11f828f208/6b95093a4a9bf34a#6b95093a4a9bf34a
--
Summary: No warning/error for duplicate construct name
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tobias dot burnus at physik dot fu-berlin dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29232