Issue |
124976
|
Summary |
[Flang] Missing compile-time diagnostic on different declare type of SOURCE and PAD argument of intrinsic RESHAPE
|
Labels |
flang:frontend
|
Assignees |
|
Reporter |
DanielCChen
|
Consider the following code:
```
program main
type Base
integer :: i = 88
end type
type, extends(Base) :: Child
integer :: j = 99
end type
type(Child) :: c1(10)
type(Child) :: c2(3,5)
class(Base), allocatable :: b1(:)
c1 = (/ (Child(i,i+100), i=1,10) /)
allocate(Child::b1(2))
c2 = reshape(c1, (/3,5/), b1, (/2,1/))
end
```
Flang is issue an error as
```
error: loc("t.f":17:5): 'hlfir.reshape' op ARRAY and PAD must be of the same type
error: verification of lowering to FIR failed
```
While the complain is correct as the standard requires SOURCE and PAD to have the same declare and dynamic type, it should be a semantic checking rather than in FIR.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs