Alessandro Fanfarillo wrote:
The gfortran.dg/dynamic_dispatch_4.f03 had this problem in the past
(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43986); currently it
calls the __free_s_bar_mod_S_bar function instead of the proper
doit().
That kind of makes sense: "foo" has no allocatable components while
"s_bar" has. Seemingly, "foo" has no "_free" component - and thus, the
first entry in "vtab" after _hash, _size, _extends, _def_init and _copy
is "doit". However, s_bar has at that position not "doit" but "_free".
My impression is that you do not add a
"_free => null()" (EXPR_NULL)
in the case that there are no allocatable components in the type or its
parents.
Side note: In class.c, please update the comment at the top by
mentioning _free after the description of "_copy".
Tobias