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

ICE with nested structure constructors

IanH
Honored Contributor II
470 Views
The following ICE's 12.0.4 (with /warn:all /check:all /standard-semantics):

[fortran]PROGRAM poly_constructor
  IMPLICIT NONE
  TYPE :: parent
    INTEGER :: component
  END TYPE parent  
  TYPE wrapper
    CLASS(parent), ALLOCATABLE :: item
  END TYPE wrapper  
  TYPE(wrapper) :: scalar  
  !****  
  scalar = wrapper(parent(2))  
END PROGRAM poly_constructor
[/fortran]
If you delete the component of parent and remove the argument 2 from the structure constructor, the form of the ICE is a bit different. Then (in addition, not independently) you can make the component non-polymorphic too, and things still go pear shaped.

(Apologies if it's already been reported, some of these examples all blur into each other after a while.)
0 Kudos
2 Replies
Steven_L_Intel1
Employee
470 Views
Thanks - I don't recall seeing these before. Escalated as issue ID DPD200169923.
0 Kudos
Steven_L_Intel1
Employee
470 Views
These issues will be fixed in a future version of the compiler.
0 Kudos
Reply