Hello world, Fortran allows pointers to contained procedures (other languages might call this nested functions), and also allows them to be called using procedure pointers (function pointers in C). This is permitted as long as the host instance is still active (the parent function is still running).
Contained procedures can access variables in their host instance. gfortran currently allows procedure pointers to contained procedures, but the association of variables in the host instance fails (PR 85537), so accessing such a variable (usually) results in a segfault. At the moment, I am at a loss of how to try to fix this. Any ideas? Is there any other language which has such a feature, so a bit of judicious copy & paste could be applied? Regards Thomas