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

via flang-commits flang-commits at lists.llvm.org
Thu Apr 23 05:04:58 PDT 2026


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

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

Can you add that an error is emitted for the following code:

```
subroutine test(c)
 character(:), allocatable :: c
 typeof(c) :: localc
end subroutine
```

This is an error because `localc` length parameters is deferred since the one of `c` are deferred, but `localc` cannot have deferred type parameters because it is local and non allocatable/pointer.

I think you do not need to add anything inside your compiler code, and that [the existing check](https://github.com/llvm/llvm-project/blob/e407fc3f3bca459977fca3f4e965d6df36524a7e/flang/lib/Semantics/check-declarations.cpp#L3882) should already fire, but I just want to check it is not missed for any reason.

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


More information about the flang-commits mailing list