Type-bound procedure prevents intrinsic function size

I’ve run into a bug with the 16.10 community edition Fortran compiler where having a type-bound procedure whose name is the same as that of an intrinsic function prevents the intrinsic function from working. The following minimal working example illustrates the problem:

program testsize
  implicit none

  type :: Foo
    integer :: bar(10)
  contains
    procedure :: size => size_foo
  end type Foo

  type :: Foo2
    integer :: bar(10)
  contains
    procedure :: size => size_foo2
  end type Foo2

contains

  subroutine size_foo(this)
    class(Foo), intent(in) :: this
    print *, size(this % bar)
  end subroutine size_foo

  subroutine size_foo2(this)
    class(Foo2), intent(in) :: this
    print *, size(this % bar)
  end subroutine size_foo2
end program testsize

When I try to compile this example, I get

PGF90-S-0038-Symbol, size, has not been explicitly declared (testsize.f90)
  0 inform,   0 warnings,   1 severes, 0 fatal for size_foo
PGF90-S-0038-Symbol, size, has not been explicitly declared (testsize.f90)
  0 inform,   0 warnings,   1 severes, 0 fatal for size_foo2

Interestingly, this example compiles fine if there is only one derived type rather than two. Also, if I remove the ‘implicit none’ statement, the error goes away as well.

We verified that this fails with 16.10, but works with 17.3, the current release.

There should be new Community Edition with 17.4, which is out this month.

dave

Thanks Dave for your quick response. I look forward to the next community edition release.