public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Bug 98897 - Erroneous procedure attribute for associate name
@ 2021-01-30  0:19 Damian Rouson
  0 siblings, 0 replies; only message in thread
From: Damian Rouson @ 2021-01-30  0:19 UTC (permalink / raw)
  To: gfortran

The behavior demonstrated below also occurs if the procedure
definition is moved to a submodule.  Workarounds include (1) declaring
"output_data" as a variable instead of an associate name or (2) making
"output" a function referencing it as such instead of calling it as a
subroutine.

% cat bug.f90
module output_data_m
  implicit none

  type output_data_t
  contains
    procedure output
  end type

  interface
    module subroutine output(self)
      implicit none
      class(output_data_t) self
    end subroutine
  end interface

contains
  module procedure output
  end procedure
end module

  use output_data_m
  implicit none
  associate(output_data => output_data_t())
    call output_data%output
  end associate
end

% gfortran bug.f90
bug.f90:24:20:
   24 |     call output_data%output
      |                    1
Error: VARIABLE attribute of ‘output_data’ conflicts with PROCEDURE
attribute at (1)

% gfortran --version
GNU Fortran (GCC) 11.0.0 20201231 (experimental)

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

only message in thread, other threads:[~2021-01-30  0:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-30  0:19 Bug 98897 - Erroneous procedure attribute for associate name 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).