Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Wrong(?) Warning 8450 with multiple user defined operators

$
0
0

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

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>