Consider the following code:
character(0), allocatable :: ch
allocate(character(-1) :: ch)
end
Flang diagnoses this case with
error: Semantic errors in t.f
./t.f:2:27: error: Character length of allocatable object in ALLOCATE must be the same as the type-spec
allocate(character(-1) :: ch)
^^
Because both of the type-spec at the declaration and the allocate statement specify zero-length, the diagnostic message seems unnecessary.
All, gfortran, ifort and XLF don't diagnose this case.