| Issue |
176038
|
| Summary |
[flang] unsigned can not be used as indexes of arrays
|
| Labels |
flang
|
| Assignees |
|
| Reporter |
foxtran
|
Considering the following code:
```
real function get(a, n, idx)
unsigned, intent(in) :: n, idx
real :: a(n)
get = a(idx)
end function get
```
Here, `unsigned` gives natural lower boundaries for `a`, however, `unsigned` can not be used in this context:
```
error: Semantic errors in /app/example.f90
/app/example.f90:3:13: error: Must have INTEGER type, but is UNSIGNED(4)
real :: a(n)
^
/app/example.f90:4:11: error: Must have INTEGER type, but is UNSIGNED(4)
get = a(idx)
^^^
Compiler returned: 1
```
See an example here: https://godbolt.org/z/8bvsoYdzT
Actually, unsigned can not be used in a lot of context, for example, in logical operation like ieor, ior, iand and so on...
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs