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

ICE in 19.04 with type bound generic interface

$
0
0

Hi,

the following code generates an internal compiler error when compiled with 19.04

Module Mod_Paof
  Implicit none
  Private
  Type, Public :: parent
  contains
    Private
    Generic, Public :: bar => foo
    Procedure, Public :: foo => subfoo_parent
  End type parent
  Type, Public, extends(parent) :: offspring
  contains
    Private
    Procedure, Public :: foo => subfoo_offspring
  End type offspring
  Interface
    Module Subroutine subfoo_parent(this)
      Class(parent), Intent(inOut) :: this
    End Subroutine
    Module Subroutine subfoo_offspring(this)
      Class(offspring), Intent(inOut) :: this
    End Subroutine
  End Interface
End Module Mod_Paof
Submodule(Mod_Paof) parent_foo
contains
  Module Procedure subfoo_parent
    Implicit None
  End Procedure
End Submodule parent_foo
Submodule(Mod_Paof) offspring_foo
contains
  Module Procedure subfoo_offspring
    Implicit None
  End procedure
End Submodule offspring_foo
Module Mod_Ttt
  use Mod_Paof, only: offspring
  Implicit None
  Private
  Type, Public :: Ttt
    Type(offspring), allocatable :: xxx
  contains
    Private
    Procedure, Pass, Public :: bar=> Subbar
  End type Ttt
  Interface
    Module Subroutine Subbar(this)
      Class(Ttt), Intent(InOut) :: this
    End Subroutine
  End Interface
End Module Mod_Ttt
Submodule(Mod_Ttt) ttt_bar
contains
  Module Procedure Subbar
    Implicit None
    !!ice crash
    call this%xxx%bar()
    !!workaround (not really)
    !call this%xxx%foo()
  End Procedure
end Submodule Ttt_Bar

it compiles with gfortran 8.3 and ifort 17.08.

The workaround is to abandon the generic interface.

cheers


Viewing all articles
Browse latest Browse all 2746

Trending Articles



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