Structure constructor for derived type bug.

Very similar bug as reported previously at Fortran derived type (mostly structure constructor) bugs.

Structure constructor for an extended type with overridden type-bound procedures. Using gnu and intel compilers, the following example is ok, but it fails using pgfortran:

$ pgfortran -V
pgfortran 16.10-0 64-bit target on x86-64 Linux -tp nehalem 
The Portland Group - PGI Compilers and Tools
Copyright (c) 2016, NVIDIA CORPORATION.  All rights reserved.

$ pgfortran test.f90
PGF90-S-0066-Too few data constants in initialization statement (test.f90: 35)
  0 inform,   0 warnings,   1 severes, 0 fatal for test_types2

module test_types1

    implicit none

    type, public :: foo
        integer :: i 
        procedure :: do_nothing
        generic   :: assignment(=) => do_nothing
    end type foo


    subroutine do_nothing(a,b)
        class(foo), intent(out) :: a
        class(foo), intent(in)  :: b
    end subroutine do_nothing

end module test_types1

module test_types2

    use test_types1
    implicit none

    type, extends(foo), public :: bar
        character(len=15) :: a
        procedure :: do_nothing => do_do_nothing
    end type bar

    type(bar), public, parameter :: f = bar(B'10000','abcd')


    subroutine do_do_nothing(a,b)
        class(bar), intent(out) :: a
        class(foo), intent(in)  :: b
    end subroutine do_do_nothing

end module test_types2

program test_pgi_construct

    use test_types2

    implicit none

    print *,f

end program test_pgi_construct

Without generic operation (=), the code is compiled correctly.

We have assigned this problem TPR 23964.


TPR 23964 - pgfortran severe error for Constructor for derived type bug “too few data constants”

has been fixed in the current 18.1 release. The Community Edition
should have this in the 18.4 release.