- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
If I compile the following code with ifort 14.0.3
module abmod implicit none type :: a integer :: value contains procedure :: assign => a_assign generic :: assignment(=) => assign end type a type, extends(a) :: b contains procedure :: assign => b_assign end type b contains subroutine a_assign(this, value) implicit none class(a), intent(out) :: this integer, intent(in) :: value print *, "I am a_assign!" this%value=value end subroutine a_assign subroutine b_assign(this, value) implicit none class(b), intent(out) :: this integer, intent(in) :: value print *, "I am b_assign!" this%value=value end subroutine b_assign end module abmod program test use abmod implicit none class(a), allocatable :: aclass class(b), allocatable :: bclass allocate(b::aclass) allocate(bclass) aclass=1 bclass=1 end program test
And run the program, I get
$ ifort -g -o test test.f90
$ ./test
I am a_assign!
I am a_assign!
$
Is this the expected behavior? I had expected that the b_assign procedure would have been called in both cases, due to the dynamic type being class b. I see similar behavior with the other operators.
If I use gfortran 4.6, 4.7 or 4.9, the b_assign procedure is called. However gfortran 4.8 shows similar behavior as ifort 14.0.3
Best regards
Emil Sørensen
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This behavior from ifort doesn’t make sense to me, I would expect assign_b to be called as well. Haven’t had time to dig through the standard yet, however.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also see the same reported behavior with our current Beta. I reported this to Development (see internal tracking id below) to get their assessment and will keep you updated on what I hear.
(Internal tracking id: DPD200358171)
(Resolution Update on 09/12/2015): This defect is fixed in the Intel® Parallel Studio XE 2016 Release (2016.0.109 - Linux)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I confirmed the associated fix for this issue in the Intel® Parallel Studio XE 2016 Release (Version 16.0.0.109 Build 20150815) available from the Intel® Software Development Products Registration Center (IRC).

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page