Issue 124777
Summary [Flang] Incorrect diagnostic on generic type-bound procedure expansion.
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code:
```
module m

   type base
      integer i
 contains
         procedure, pass :: add3
         procedure :: adde
 generic :: operator(+) => add3
   end type

   interface operator(+)
 module procedure adde
   end interface

   contains

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

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

end module

program genericOperatorResolve007a
   use m

   type(base) :: b0
   type(base), allocatable :: b3(:,:,:)

   b0 = b0 + b3 !! ERROR not expected

end program
```

Flang currently issues an error as:
```
error: Semantic errors in t.f
./t.f:33:4: error: No intrinsic or user-defined ASSIGNMENT(=) matches scalar TYPE(base) and rank 3 array of TYPE(base)
     b0 = b0 + b3
     ^^^^^^^^^^^^
```

It seems the generic interface expansion of `adde` is the culprit as the code passed after I removed it.
All ifort , gfortran and XLF compile the code successfully.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to