- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I was trying to something like
I was trying to something like
[fortran]module mod
type :: one
contains
procedure :: f
end type one
contains
integer function f(this)
class(one) :: this
f = 3
end function f
end module mod
program test
use mod
character(:), allocatable :: a
type(one) :: t
allocate(character(t%f()) :: a)
end program test
[/fortran] but this resulted in[fortran][merry] misc > ifort -free intel_alloc_char_bug.f intel_alloc_char_bug.f(24): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance. allocate(character(t%f()) :: a) ^ [ Aborting due to internal error. ] compilation aborted for intel_alloc_char_bug.f (code 1) [/fortran]Does this has to do with parameterized derived-types not being supported yet? A simpler example works:
[fortran]program test
character(:), allocatable :: a
allocate(character(f()) :: a)
contains
integer function f()
f = 3
end function f
end program test
[/fortran] Teemu Laakso
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, this is simply a compiler bug where it has trouble when a type-bound-procedure is in the length field. No relation to parameterized derived types. The following alternative works:
[fortran]program test use mod character(:), allocatable :: a type(one) :: t integer fx fx = t%f() allocate(character(fx) :: a) end program test [/fortran]I will report this to the developers. Issue ID is DPD200176247.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for a future version of the compiler.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page