Compilation fails for a generic type bound procedure in Fortran, when it aliases an aliased private type bound procedure.
Operating system is a Manjaro Linux.
Compiler used
pgfortran -V
pgfortran 19.10-0 LLVM 64-bit target on x86-64 Linux -tp sandybridge
PGI Compilers and Tools
Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
A minimal working example is provided with:
module a_module
implicit none
public :: a_type
private
type :: a_type
contains
generic :: proc => proc1
procedure, private :: proc1 => proc1_impl
end type a_type
contains
subroutine proc1_impl(self)
class(a_type) :: self
end subroutine proc1_impl
end module a_module
program mwe
use a_module
implicit none
type(a_type) :: obj
call obj%proc
end program mwe
Invoking the PGI compiler results in an error
pgfortran mwe.f90
PGF90-S-0155-cannot access PRIVATE type bound procedure proc1$tbp (bug1.f90: 24)
0 inform, 0 warnings, 1 severes, 0 fatal for mwe
Expected behaviour is compiling the program.
A workaround is possible by not aliasing the private procedure, which seem to cause the issue in the first place.