Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

ICE when using structure constructor in user-defined constructor

$
0
0

ifort seems to have trouble with the following code:

module test_constructor_name

implicit none

type :: foo
   integer :: a(1)
end type foo

interface foo
   module procedure new_foo
end interface

contains

  function new_foo(b, c) result(the_foo)
    integer, intent(in) :: b(1), c
    type(foo) :: the_foo
    the_foo = foo(b + c)
  end function new_foo

end module test_constructor_name

Compiling this with a simple "ifort -c" will show the error:

test_constructor_name.F90(18): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.

    the_foo = foo(b + c)

^

[ Aborting due to internal error. ]

compilation aborted for test_constructor_name.F90 (code 1)

 

This bug seems to have been around for a while, but is still in version 14.0:

Version 12.1.5.339 Build 20120612

Version 14.0.2.144 Build 20140120


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>