Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

Final not being called for associate

$
0
0

The code below does not call the object finalization code in ifort 14.0.1, and I think it should. I've submitted it as issue 6000044034 last year, but still seem to be stuck in "investigating" limbo.

    module A
    Type T
     integer :: val = 2
    contains
    final :: testfree
    end type
    contains

    subroutine testfree(this)
    Type(T) this

	print *,'freed'
    end subroutine

    subroutine Testf()

	associate(X => T())
		print *, X%val
	end associate
    print *,'ended'
    end subroutine Testf

    end module

    program tester
    use A

    call Testf

    end program

 


Viewing all articles
Browse latest Browse all 3108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>