- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think structure constructors that include a parent component can confuse the current release of the compiler.
[fortran]MODULE m20130816
IMPLICIT NONE
TYPE :: Parent
LOGICAL :: l
INTEGER, ALLOCATABLE :: array(:)
END TYPE Parent
TYPE, EXTENDS(Parent) :: Extension
REAL :: b
REAL :: c
END TYPE Extension
END MODULE m20130816
PROGRAM ExtensionStructureConstructor
USE m20130816
IMPLICIT NONE
TYPE(Parent) :: p_scalar
TYPE(Parent) :: p_array(2)
TYPE(Extension) :: e
!****
p_scalar = Parent(.FALSE., [1, 2, 3])
! This one is ok.
e = Extension(PARENT=p_scalar, B=2.0, C=3.0)
p_array(1) = Parent(.FALSE., [1, 2, 3])
! This one gives error #8212.
e = Extension(PARENT=p_array(1), B=2.0, C=3.0)
END PROGRAM ExtensionStructureConstructor
[/fortran]
[plain]>ifort /c /check:all /warn:all /standard-semantics ExtensionStructureConstructor.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.3.198 Build 20130607
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.
ExtensionStructureConstructor.f90(26): error #8212: Omitted field is not initialized. Field initialization missing:
e = Extension(PARENT=p_array(1), B=2.0, C=3.0)
^
compilation aborted for ExtensionStructureConstructor.f90 (code 1)[/plain]
I think the error message is exhorting me to break F2008 C491. But me mum told me not to do that, or I'd get into big trouble.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know we've had problems like this in the past, but I still see the error here in our latest compiler. Let me look at it in more detail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ian, thanks for the nice example. Escalated as issue DPD200247227.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This bug has been fixed - I expect the fix to appear in the October update.

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