Issue 148255
Summary [flang] Inconsistent behavior with allocating a zero-sized array
Labels flang:runtime
Assignees
Reporter DanielCChen
    Consider the following code:

```
real, allocatable :: r1(:)

allocate(r1(0))
print*, allocated(r1)

allocate(r1, source=[real:: ])
print*, allocated(r1)

end
```
Flang outputs
```
> a.out
 F
 T
```

Both ALLOCATE statement allocate a zero-sized array, so the output should be consistent. 
Since the standard allows allocating a zero-sized array, the result of calling ALLOCATED should be `T`.


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to