I think it’s flang-new. That (classic) flang you showed doesn’t seem to support F2008’s recursive derived types using allocatable components —POINTERs must be used, as mentioned by the error message.
Something similar applies to older versions of gfortran.
These linked lists can be setup in several ways, but fortran allows the use of allocatable arrays and derived types, which simplifies many operations. For example, to delete the entire linked list, you just need to do
deallocate( list )
and the compiler traverses the whole list with no chance of memory leaks or dangling pointers. You can also define a pointer that traverses the list in a straightforward way. I used the move_alloc() intrinsic to add to the list, members can also be removed from the list that way. The programmer has lots of options with fortran.
Ron Shepard’s allocatable approach is better as it’s safer and simpler. I didn’t know about that back when I wrote my logger. I think I first learned about allocatable linked lists when reading the Intel Fortran Compiler forum in the past year or two. Another mistake I made was that I made it too complicated by having separate impure and pure loggers. Eventually, I will rewrite my logger to fix these issues.