Summary: Relational operators .eq. and == are not recognized as
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran

The first paragraph of 7.2 in the standard states that "The operators <, ...
always have the same interpretations as the operators .LT., ..."  Consider the
following example:

module foo_type
  public :: foo, operator(==)
  type :: foo
    integer :: bar
  end type
  interface operator(.eq.)
    module procedure eq_foo
  end interface
  logical function eq_foo (a, b)
    type(foo), intent(in) :: a, b
    eq_foo = (a%bar == b%bar)
  end function
end module

subroutine use_it (a, b)
  use foo_type
  type(foo) :: a, b
  print *, a == b
end subroutine

The compiler incorrectly complains (essentially) that it has no == operator for
the operands when in fact it should -- it appears that the defined .EQ.
operator is not being treated as the same as == in the module.  Here's the
compiler error:

  print *, a == b
Error: Operands of comparison operator '==' at (1) are TYPE(foo)/TYPE(foo)

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Reply via email to