public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Bug 84622 - [F08] gfortran accepts invalid intent(out) polymorphic dummy argument with coarray component
@ 2018-02-28 23:43 Damian Rouson
  0 siblings, 0 replies; only message in thread
From: Damian Rouson @ 2018-02-28 23:43 UTC (permalink / raw)
  To: gfortran

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-28 23:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28 23:43 Bug 84622 - [F08] gfortran accepts invalid intent(out) polymorphic dummy argument with coarray component Damian Rouson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).