possible bug in pgf90 12.1-0

This code produces an error with (pgf90 12.1-0 64-bit target on x86-64 Linux -tp istanbul)

I suspect there’s some confusion over the shm identifier but I am not sure.

The nagfor compiler (NAG Fortran Compiler Release 5.3 859)
rejects the code as non-valid f90 or f95 but accepts it as valid f2003 or f2008.

PGF90-S-0155-Derived type has not been declared - shm (shm_bug.f90: 17)
0 inform, 0 warnings, 1 severes, 0 fatal for constructor
PGF90-S-0155-Derived type has not been declared - shm (shm_bug.f90: 24)
0 inform, 0 warnings, 1 severes, 0 fatal for getshmid


module shm_mod
  implicit none
  private
  public :: shm
  type shm             
     integer      :: shm_id = -999 
   contains
     procedure :: shm => getShmid
!!  above fails but with next line instead compiles ok
!!   procedure :: shmoo => getShmid
  end type shm
  interface shm
     procedure constructor
  end interface
contains
  function constructor (error)
    class(shm), pointer                 :: constructor 
    integer                             :: error       
    ! code missing
    allocate(constructor)
    error = 0
  end function constructor
  function getShmid (this)
    class(shm)  :: this
    integer     :: getShmid
    getShmid = this%shm_id
  end function getShmid
end module shm_mod

Hi themos,

FYI, I needed to send this on to one of our compiler engineers and am waiting for a response. I’ll let you know what I find out.

Thanks,
Mat

Hi themos,

Yes, it is a compiler error and TPR#18558 was opened to track this issue. Note that the error has been corrected and a fix should be available in the 12.4 release.

Thank you for the report!
Mat