Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28487 Discussions

Wrong(?) Warning 8450 with multiple user defined operators

Wolf_W_
New Contributor I
379 Views

Hello, the example below produces two warnings #8450:

"The type/rank signature for this specific function and its arguments matches another specific function that shares the same OPERATOR generic binding.   [BINARY_OP_B]"
"The type/rank signature for this specific function and its arguments matches another specific function that shares the same OPERATOR generic binding.   [BINARY_OP_C]"

The warnings disappear, when the unitary operator binding (line 24) is commented out.
Is this a bug? Or am i doing something wrong?

Greetings
Wolf

Compiler: 15.5 and 16.1
 

module FOO
  implicit none

!=================================================================
  type, abstract :: ABSTRACT_TYPE
  contains

    procedure :: binary_op_A
    generic :: operator(.A.) => binary_op_A

    procedure :: binary_op_B
    generic :: operator(.B.) => binary_op_B

    procedure :: binary_op_C
    generic :: operator(.C.) => binary_op_C

  end type ABSTRACT_TYPE

!=================================================================
  type, extends (ABSTRACT_TYPE) :: EXTENDED_TYPE
  contains

    procedure :: unitary_op
    generic :: operator(.U.) => unitary_op !no warning without this line
    generic :: normiere => unitary_op

  end type EXTENDED_TYPE

!=================================================================
contains
!=================================================================

  elemental function unitary_op(rhs) result(res)
    class(EXTENDED_TYPE), intent(in   ) :: rhs
    type(EXTENDED_TYPE)                 :: res
  end function unitary_op

  elemental function binary_op_A(lhs, rhs) result(res)
    class(ABSTRACT_TYPE), intent(in   ) :: lhs, rhs
    real                                :: res
  end function binary_op_A

  elemental function binary_op_B(lhs, rhs) result(res)
    class(ABSTRACT_TYPE), intent(in   ) :: lhs, rhs
    type(EXTENDED_TYPE)                 :: res
  end function binary_op_B

  elemental function binary_op_C(lhs, rhs) result(res)
    class(ABSTRACT_TYPE), intent(in   ) :: lhs, rhs
    real                                :: res
  end function binary_op_C

!=================================================================
end module FOO

 

0 Kudos
3 Replies
FortranFan
Honored Contributor II
379 Views

To me, the compiler warnings of 8450 seem spurious for the code shown in the original post.

0 Kudos
Steven_L_Intel1
Employee
379 Views

That is weird...  Escalated as issue DPD200380766.

0 Kudos
Steven_L_Intel1
Employee
379 Views

Fixed for a release later this year.

0 Kudos
Reply