Hello, Le 07/07/2023 à 20:23, Harald Anlauf a écrit : > Hi Mikael, > > Am 07.07.23 um 14:21 schrieb Mikael Morin: >> I'm attaching what I have (lightly) tested so far, which doesn't work. >> It seems gfc_conv_class_to_class reevaluates part of the original >> expression, which is not correct after deallocation. > > this looks much more elegant than my attempt that passed an additional > argument to gfc_conv_class_to_class, to achieve what your patch does. > >> Will have a look again tonight. > > Great. > > Harald > here is what I'm finally coming to. This patch fixes my example, but is otherwise untested. The patch has grown enough that I'm tempted to fix my example separately, in its own commit. Mikael