Issue 143900
Summary [flang] Allocate object must be conformable with the `SOURCE=` in an ALLOCATE statement
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code
```
    type base
        real      :: r1
    end type

    type (base), allocatable :: b1(:)
    type (base) :: b2 (10)

 b2 = base(10.0)

    allocate (b1(5), source=(/(b2(j),j=10,6)/))  !<-- this is illegal
end
```

The shape of the `SOURCE=` expr is 0 while the shape of the allocate object is `5`.
It is not conforming to the standard. All ifort, gfortran and XLF issues an error.
Is this an intentional extension for Flang?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to