Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28457 Discussions

internal compiler error when initializing type extended from empty user defined type

joseph_battelle
Beginner
304 Views
[fortran]program C2
    type t
    end type t
    
    type, extends (t) :: t1
        integer :: i    
    end type t1
    
    type(t1) :: b = t1(5)
    
end program C2[/fortran]
Compiling with Intel Visual Fortran 11.1.065 [IA-32]...
sandbox.f90
fortcom: Fatal: There has been an internal compiler error (C0000005).
This doesn't seem to violate the restrictions on empty types called out in the release notes. The internal compiler error goes away if the base type is not empty and the structure constructor contains an initializer for it.
3.5.4 Limited Support for Empty Derived Types
Fortran 2003 adds the ability to declare a derived type with no data components. The Intel
compiler has limited support for these in the current release. These limitations will be lifted in a
future release of the compiler. The limitations are as follows:
When an object of derived type is declared, the type must have at least one data
component. Extending an empty type is supported. For example:
type t
end type
type, extends (t) :: t1
end type
type, extends (t1) :: t2
integer i
end type
type, extends (t2) :: t3
end type
type (t) :: rec1 ! Not supported, type t is empty
type (t1) :: rec2 ! Not supported, type t1 is empty
type (t2) :: rec3 ! Supported, type t2 is not empty
type (t3) :: rec4 ! Supported, type t3 is not empty
0 Kudos
1 Solution
Steven_L_Intel1
Employee
304 Views
Thanks. I can reproduce this and will report it to the developers. Issue ID is DPD200156821.

View solution in original post

0 Kudos
2 Replies
Steven_L_Intel1
Employee
305 Views
Thanks. I can reproduce this and will report it to the developers. Issue ID is DPD200156821.
0 Kudos
Steven_L_Intel1
Employee
304 Views
This is expected to be fixed in the next major release of the compiler, scheduled for November.
0 Kudos
Reply