[flang-commits] [flang] [flang] Rework component KIND= values in PDT instantiations (PR #162367)

Daniel Chen via flang-commits flang-commits at lists.llvm.org
Wed Oct 8 09:53:11 PDT 2025


https://github.com/DanielCChen commented:

It seems the evaluation of the KIND parameter of `i` is not correct as shown in the following code:

```
module m
   type base(k1,k2)
      integer(1),kind :: k1
      integer(k1),kind :: k2
      integer(kind(int(k1,1)+int(k2,k1))),allocatable :: i(:)
   end type
end module

program d353692

  use m
  implicit none

  type(base(2,2)) ::t
  print*, t%i%kind

  print*, kind(int(2,1)+int(2,2))
end
```

Flang outputs
```
4
2
```

But the expected output should be 
```
2
2
```



https://github.com/llvm/llvm-project/pull/162367


More information about the flang-commits mailing list