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

ICE with derived type initialization

John4
Valued Contributor I
985 Views

Maybe someone else already reported on this, but... When compiling the code below, I get an Internal Compiler Error ---I'm not sure if the code below is valid; I first tried with ALLOCATABLE instead of POINTER (with NULL() added for the second component), but there seems to be a restriction for that kind of initialization at the declaration level.

!------------------------------------------------------------------------------
module mod1

implicit none
private
save

type, public :: t1
character(63) :: name
character(255), pointer :: txt(:) => NULL()
end type

end module mod1

module mod2

use mod1

implicit none
private
save

type(t1) :: t = t1('something')

end module mod2
!------------------------------------------------------------------------------

0 Kudos
1 Solution
IDZ_A_Intel
Employee
985 Views
This bug will be fixed in a future product update - probably the first update after the next major release.

View solution in original post

0 Kudos
2 Replies
IDZ_A_Intel
Employee
985 Views
An internal compiler error is always a compiler bug - doesn't matter if your code is legal or not. To the best of my knowledge, your code is legal. I'll report this to the developers. Issue ID is DPD200158131.
0 Kudos
IDZ_A_Intel
Employee
986 Views
This bug will be fixed in a future product update - probably the first update after the next major release.
0 Kudos
Reply