public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Damian Rouson <damian@sourceryinstitute.org>
To: gfortran <fortran@gcc.gnu.org>
Cc: "Clune, Thomas L. (GSFC-6101)" <thomas.l.clune@nasa.gov>
Subject: Bug 86906 - erroneous name clash with renaming in use statement
Date: Thu, 09 Aug 2018 21:36:00 -0000	[thread overview]
Message-ID: <CACR8rvc1ixSQDnjGRg6umwGM3tZ7yqjgiZpx_k9BqEjbr5GOpw@mail.gmail.com> (raw)

gfortran 6.4, 7.3, and 8.2 all produce the error message below when
attempting to use a renamed type in the same scope as the variable that
motivated the renaming:

$ cat foo.f90
module foo
  type config
  end type
end module
  use foo, only: foo_config => config
contains
  subroutine cap
    integer config
    type(foo_config) extra
  end subroutine
end

$ gfortran foo.f90
foo.f90:9:26:

     integer config
                  2
     type(foo_config) extra
                          1
Error: The type ‘config’ cannot be host associated at (1) because it is
blocked by an incompatible object of the same name declared at (2)

$ gfortran --version
GNU Fortran (GCC) 8.2.0

             reply	other threads:[~2018-08-09 21:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 21:36 Damian Rouson [this message]
2018-08-12  8:55 ` Paul Richard Thomas
2018-08-12 15:38   ` Paul Richard Thomas
2018-08-12 16:26     ` Damian Rouson
2018-08-12 17:55       ` Clune, Thomas L. (GSFC-6101)

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=CACR8rvc1ixSQDnjGRg6umwGM3tZ7yqjgiZpx_k9BqEjbr5GOpw@mail.gmail.com \
    --to=damian@sourceryinstitute.org \
    --cc=fortran@gcc.gnu.org \
    --cc=thomas.l.clune@nasa.gov \
    /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).