https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79230
--- Comment #9 from janus at gcc dot gnu.org ---
(In reply to janus from comment #8)
> Or maybe we should rather call the finalization wrapper for the type
> 'data_t'
That's also what's happening to 'par_real' in the following case:
subroutine evaluator
class(data_t), allocatable, target :: par_real
type(t1_t) :: field
field%width_data => par_real
end subroutine
as seen in the dump:
if (par_real._data != 0B)
{
if (par_real._vptr->_final != 0B)
{
{
struct array0_data_t desc.6;
desc.6.dtype = 552;
desc.6.data = (void * restrict) par_real._data;
par_real._vptr->_final (&desc.6, par_real._vptr->_size, 0);
}
}
__builtin_free ((void *) par_real._data);
}
So, yes, that's the way to go also for the 'width_data' component.