- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]module mytype_class
type mytype
integer,allocatable :: int(:)
contains
procedure :: aFunction => the_Function
procedure :: aSubroutine => the_Subroutine
procedure :: print => my_print
end type mytype
contains
function new_mytype(dim) result(this)
integer :: dim,n
type(mytype) :: this
allocate(this%int(dim))
do n=1,dim
this%int(n)=n
enddo
end function
subroutine my_print(this)
class(mytype) :: this
print *,this%int
end subroutine
subroutine the_Subroutine(this)
class(mytype),intent(INOUT) :: this
this%int=2*this%int
end subroutine
function the_Function(this) result(newone)
class(mytype),intent(INOUT) :: this
type(mytype) :: newone
this%int=2*this%int
newone=new_mytype(size(this%int))
newone%int=2*this%int
end function
end module mytype_class
program TestTypeBoundProcs
use mytype_class
implicit none
type(mytype) :: A,C
A=new_mytype(3)
call A%print()
call A%aSubroutine()
call A%print()
! C=A%aFunction() !THIS FREEZES THE COMPILER
C=the_Function(A) !THIS IS EQUIVALENT BUT WORKS
call A%print()
call C%print()
end program TestTypeBoundProcs
[/fortran] Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the convenient reproducer (not long by any standard). The line noted clearly sends the compiler into an infinite allocation loop that should not occur. I directed the issue to Development (refer to internal tracking id below) and will update this thread as I learn more.
I have to defer your question about the difference between "a type bound operator and a generic operator" to others here who are more knowledgeable and may be able to answer. I did also include your question in the report to Development and will share any details provided.
(Internal tracking id: DPD200156693)
(Resolution Update on 11/30/2010): This defect is fixed in the Intel Fortran Composer XE 2011 initial release (12.0.0.085 - Mac OS)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel Fortran Composer XE 2011 initial release (12.0.0.085 - Mac OS) with the fix is available from the Intel Registration Center: https://registrationcenter.intel.com
The test case now compiles successfully.
$ ifort -V -c u75310.f90
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.0.085 Build 20101006
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
Intel Fortran 12.0-1176
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page