- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the following code does not compile:
ifort_constructor.f90(7): error #8212: Omitted field is not initialized. Field initialization missing: [NEXT]
type(t), parameter :: empty = t() ! Rejected
^
compilation aborted for ifort_constructor.f90 (code 1)
When replacing t() by t(NULL()) in the initialization for empty the code compiles.
Is there a reason why the default constructor does not work, or is it a bug?
the following code does not compile:
[fortran]program ifort_constructor implicit none type t type(t), pointer :: next(:) => NULL () end type t type(t) :: list = t() ! Accepted type(t), parameter :: empty = t() ! Rejected end program ifort_constructor [/fortran]% ifort -stand f03 -standard-semantics -warn all ifort_constructor.f90
ifort_constructor.f90(7): error #8212: Omitted field is not initialized. Field initialization missing: [NEXT]
type(t), parameter :: empty = t() ! Rejected
^
compilation aborted for ifort_constructor.f90 (code 1)
When replacing t() by t(NULL()) in the initialization for empty the code compiles.
Is there a reason why the default constructor does not work, or is it a bug?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bug. Escalated as DPD200176794. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is fixed for a release later this year.
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