[flang-commits] [flang] [flang] Add support for TYPEOF and CLASSOF type specifiers (PR #188804)

via flang-commits flang-commits at lists.llvm.org
Tue Apr 7 08:51:33 PDT 2026


================

----------------
jeanPerier wrote:

I think more work may be needed to deal with assumed-length characters and with PDTs in general.

As I am reading the standard, TYPEOF(c) where c is `CHARACTER(*)` creates a CHARACTER(len(c)), not a `CHARACTER(*)`.

This distinction matters in the following example:

```
module m
contains
subroutine test(c1, c2)
  character(*) :: c1
  TYPEOF(c1) :: c2
  print *, len(c2)
 end subroutine
end module

 use m
 character(2) :: c1
 character(3) :: c2
 call test(c1, c2)
end
```

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


More information about the flang-commits mailing list