Unverified Commit 710503fc authored by jeanPerier's avatar jeanPerier Committed by GitHub
Browse files

[flang] Finalize polymorphic alloctable component if needed (#67326)

The runtime skips finalization if the runtime type info
"nofinalizationneeded" is set, so it should not be set if the derived
type has polymorphic allocatable components since they may be allocated
to some type extension with a final methods.
IsFinalizable cannot be updated since polymorphic allocatable components
do not imply a final routine will actually be called (it depends of the
dynamic type, which semantics cannot know about), and this would not
match the "Finalizable" definition of the standard in 7.5.6.1. Hence,
this patch adds a MayRequireFinalization helper.

The component visitor change is to avoid crashing in
FindPolymorphicAllocatableUltimateComponent in the test
test/Driver/dump-all-bad.f90 that tries generating runtime type info
even after some semantic error is raised under debug-dump options.
parent 8c556b7e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment