Issue 124772
Summary [Flang] Incorrect diagnostic on multiple type-bound procedure `binding-name`s point to the same specific `procedure-name`
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code:
```
module m

   type base
      integer :: i = -999
      contains
         procedure, pass(b) :: base1 => base_base_base
         procedure, pass(b) :: base2 => base_base_base
 generic :: operator(+) => base1, base2
   end type

   contains

 type(base) function base_base_base ( a, b )
      class(base), intent(in) :: a
      class(base), intent(in) :: b
   end function

end module
```

Flang currently issues an error as:
```
error: Semantic errors in t.f
./t.f:8:21: error: Generic 'OPERATOR(+)' may not have specific procedures 'base%base1' and 'base%base2' as their interfaces are not distinguishable
           generic :: operator(+) => base1, base2
 ^^^^^^^^^^^
./t.f:13:24: Procedure 'base1' of type 'base' is bound to 'base_base_base'
     type(base) function base_base_base ( a, b )
 ^^^^^^^^^^^^^^
./t.f:13:24: Procedure 'base2' of type 'base' is bound to 'base_base_base'
     type(base) function base_base_base ( a, b )
                         ^^^^^^^^^^^^^^
```

The code seems conforming to me as I can't find any wording in the standard prohibit this usage.

Note: This could be a duplicate to issue #124766 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to