This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37425] New: Fortran 2003: GENERIC bindings as operators
- From: "domob at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Sep 2008 14:14:09 -0000
- Subject: [Bug fortran/37425] New: Fortran 2003: GENERIC bindings as operators
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GENERIC type-bound procedures are currently implemented in gfortran, but only
by name and not as operators as in the following example (the polymorphic
passed-object problem included):
MODULE m
IMPLICIT NONE
TYPE :: t
INTEGER :: i
CONTAINS
PROCEDURE :: assign_t_from_int
PROCEDURE :: equals_t_int
GENERIC :: ASSIGNMENT(=) => assign_t_from_int
GENERIC :: OPERATOR(==) => equals_t_int
END TYPE t
CONTAINS
SUBROUTINE assign_t_from_int (me, i)
IMPLICIT NONE
TYPE(t), INTENT(OUT) :: me
INTEGER, INTENT(IN) :: i
me = t (i)
END SUBROUTINE assign_t_from_int
LOGICAL FUNCTION equals_t_int (me, i)
IMPLICIT NONE
TYPE(t) :: me
INTEGER :: i
equals_t_int = (me%i == i)
END FUNCTION equals_t_int
END MODULE m
--
Summary: Fortran 2003: GENERIC bindings as operators
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: domob at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37425