From j3-fortran.org/doc/year/24/24-007.pdf > C1594 The function result of a pure function shall not be both polymorphic and allocatable, or have a poly38 morphic allocatable ultimate component. gfortran, ifort, and ifx have been fine with it, but apparently they're more tolerant of this (e.g. https://stackoverflow.com/questions/76653898/memory-leak-with-runtime-polymorphism). Discovered by flang-new