# Should associate trigger automatic finalization?

**URL:** <https://fortran-lang.discourse.group/t/should-associate-trigger-automatic-finalization/2324>\
**Category:** Help\
**Created:** [November 23, 2021, 1:33pm UTC](https://fortran-lang.discourse.group/t/should-associate-trigger-automatic-finalization/2324 "2021-11-23T13:33:18Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Reinhold\_Bader](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Reinhold\_Bader](https://fortran-lang.discourse.group/u/Reinhold_Bader)\
**Post date:** [November 23, 2021, 3:39pm UTC](https://fortran-lang.discourse.group/t/should-associate-trigger-automatic-finalization/2324/6 "2021-11-23T15:39:37Z")

</div>

For the case where the structure constructor is used: no finalization should happen here at all, because use of the structure constructor is not one of the trigger cases.

For the case where a function overloads the structure constructor, the following text from the standard applies, I think:

F2018 / 7.5.6.3 when finalization occurs  
…  
If an executable construct references a nonpointer function, the result is finalized after execution of the innermost executable construct containing the reference.  
…  
which I take to mean that the finalizer must be executed once the ASSOCIATE block completes.

Regards  
Reinhold

---

_[View the full topic](https://fortran-lang.discourse.group/t/should-associate-trigger-automatic-finalization/2324)._
