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

yet another bug(??) in parameterized derived type

$
0
0

Hi all

when running this code:

Module testmod
  Private
  Type, Public, abstract :: myroot(k)
    Integer, kind :: k
  End type myroot
  Type, Public, extends(myroot), abstract :: myvec
    Integer(kind=8) :: lb1=1,ub1
  End type myvec
  Type, Public, extends(myvec) :: myvec_int
    Integer(k), allocatable :: val(:,:)
  contains
    Procedure, Pass :: suba
  End type myvec_int
  Interface
    Module Subroutine suba(this)
      class(myvec_int(8)), Intent(inout) ::  this
    end Subroutine suba
  end Interface
End Module testmod
Program Test
  use testmod
  Implicit none
  Type(myvec_int(8)), allocatable :: a
  allocate(a)
  write(*,*) a%lb1
End Program Test

the parameterized derviced type (lb1 in myvec) looses its default initialization. a%lb1 is written out with zero. This does not happen if no procedure is bound to myvec_int. From my understanding this is a bug in 17.07 and 18.03.

cheers


Viewing all articles
Browse latest Browse all 2746

Trending Articles