public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "damian at sourceryinstitute dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/98897] New: Erroneous procedure attribute for associate name
Date: Sat, 30 Jan 2021 00:13:57 +0000	[thread overview]
Message-ID: <bug-98897-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98897

            Bug ID: 98897
           Summary: Erroneous procedure attribute for associate name
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at sourceryinstitute dot org
  Target Milestone: ---

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)

             reply	other threads:[~2021-01-30  0:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-30  0:13 damian at sourceryinstitute dot org [this message]
2021-02-01  8:56 ` [Bug fortran/98897] " burnus at gcc dot gnu.org
2021-02-02 12:05 ` pault at gcc dot gnu.org
2021-02-02 16:28 ` damian at sourceryinstitute dot org
2021-02-11 13:25 ` cvs-commit at gcc dot gnu.org
2021-02-11 19:10 ` cvs-commit at gcc dot gnu.org
2021-02-11 19:11 ` pault at gcc dot gnu.org
2021-02-13 11:53 ` dominiq at lps dot ens.fr
2021-02-23  0:43 ` damian at sourceryinstitute dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98897-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).