Hello Harald,
As nicely described in the PR, we mishandled the case of passing optional allocatable DT arguments with allocatable components when the INTENT was declared as INTENT(OUT), as we unconditionally tried to deallocate these components even when the argument was not present. The obvious solution is to wrap the code for deallocation by a check for presence.
Looks good.
Regtested on x86_64-pc-linux-gnu. OK for mainline?
Sure!
As this is a potentially nasty wrong-code bug, I'd like to backport to at least 11-branch.
OK for all open branches as far as you want to go. Thanks for the patch! Best regards Thomas