https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110987

--- Comment #7 from anlauf at gcc dot gnu.org ---
(In reply to John Haiducek from comment #6)
> I encountered what appears to be the same bug under slightly different
> conditions; I've attached the corresponding code (see attachment named
> "Additional test case"). In this code the crash occurs when finalizing an
> object of a type that inherits from a parent type, where the child type has
> no data members of its own.
> 
> There are several workarounds that prevent the segmentation fault in this
> test:
> - Create the object with the default constructor rather than using a custom
> constructor
> - Add a data member to the child type
> - Remove the final routine from the child type

After the patch in comment#3 the testcase in comment#5 runs cleanly under
valgrind for me.

> - gfortran 14.0.1 experimental on Windows (but in this case there are still
> indications of incorrect behavior; no segfault occurred but a print
> statement added to the end of the code did not produce any output)

I added

  print *, kid% name

and it printed

 Name

Reply via email to