Bug 84622 - [F08] gfortran accepts invalid intent(out) polymorphic dummy argument with coarray component

Damian Rouson damian@sourceryinstitute.org
Wed Feb 28 23:43:00 GMT 2018


All,

gfortran 7 and 8 accept the following invalid code when the dummy argument is declared with "class" but give the correct error message when "type" replaces "class":

  type foo
    logical, allocatable :: bar[:]
  end type
contains
  subroutine foobar(this)
    class(foo), intent(out) :: this
  end subroutine
end

This prompted my first foray into the GCC source.  My guess first guess is that the following condition at line 15063 in resolve.c is failing to evaluate to true:

if ((((sym->ts.type == BT_DERIVED && sym->ts.u.derived->attr.coarray_comp)

presumably because attr.coarray_comp is not being set for a polymorphic variable.  Any guidance on how to further diagnose and fix this or is it more likely to be something else?

Damian



More information about the Fortran mailing list