- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort version:12.1.0 20110811I would like to call a constructor in the following example. Is there any way to do it, apart removing the pointer from the type definition, and not causing a compiler error?code:[fortran]module class_a type :: a procedure(f_interface), pointer :: f => null() end type a abstract interface subroutine f_interface( arg ) import :: a class(a) :: arg end subroutine f_interface end interface end module class_a program test use class_a type(a) :: aa aa = a() end program test[/fortran]
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Calling a constructor with f nullified explicitely works just fine:
[fortran]module class_a
type :: a
procedure(f_interface), pointer :: f => null()
real :: a = 0.
end type a
abstract interface
subroutine f_interface( arg )
import :: a
class(a) :: arg
end subroutine f_interface
end interface
end module class_a
program test
use class_a
type(a) :: aa
aa = a( f = null() )
end program test
[/fortran] Anyway, the example in the previous post should work as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - I have reported this as issue DPD200174320. I found another variant that also gets the internal compiler error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can I track the status of the issue somehow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Subscribe to this thread. I will post updates when I get them. Is this blocking you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If weren't for the workaround I would complain more:-). Right now this issue is not critical to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was fixed in the 13.1 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