public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/39290] Subroutine/function ambiguity in generics
Date: Sun, 28 Apr 2013 18:35:00 -0000 [thread overview]
Message-ID: <bug-39290-4-oQXiaOGIbf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-39290-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39290
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |janus at gcc dot gnu.org
--- Comment #6 from janus at gcc dot gnu.org 2013-04-28 18:35:43 UTC ---
(In reply to comment #4)
> Actually, the valid test doesn't work as `qc' instead of `qr' is called in the
> first call.
It *does* work if one explicitly declares 'ff' as real (and fixes the
implementation of 'cc' to be complex):
function ff()
ff = 4
end function ff
complex function cc()
cc = (5,6)
end function cc
subroutine qr(f)
real, external :: f
complex c
common /a/ r, c
r = f()
end subroutine
subroutine qc(f)
complex, external :: f
complex c
common /a/ r, c
c = f()
end subroutine
module m
interface q
subroutine qr(f)
real, external :: f
end subroutine
subroutine qc(f)
complex, external :: f
end subroutine
end interface q
end module m
program main
use m
external ff, cc
complex cc, c
real ff
common /a/ r, c
r = 1
c = (2, 3)
call q(ff)
!print *, r, c
if (r /= 4 ) call abort
!print *, c
if (c /= (2,3)) call abort
call q(cc)
!print *, r
if (r /= 4 ) call abort
!print *, c
if (c /= (5,6)) call abort
end
I absolutely *never* use implicit declarations, therefore I'm not sure: Is an
"external ff" declaration supposed to get implicitly typed as real in comment
4? If yes, then it's apparently a bug that we don't do this ...
next prev parent reply other threads:[~2013-04-28 18:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-39290-4@http.gcc.gnu.org/bugzilla/>
2012-08-12 11:27 ` mikael at gcc dot gnu.org
2012-08-12 13:01 ` burnus at gcc dot gnu.org
2012-08-18 21:56 ` mikael at gcc dot gnu.org
2012-08-18 22:00 ` mikael at gcc dot gnu.org
2013-04-28 18:35 ` janus at gcc dot gnu.org [this message]
2013-04-29 9:31 ` burnus at gcc dot gnu.org
2013-04-29 10:59 ` mikael at gcc dot gnu.org
2013-04-29 12:40 ` burnus at gcc dot gnu.org
2013-04-29 14:53 ` janus at gcc dot gnu.org
2013-07-16 6:17 ` burnus at gcc dot gnu.org
2009-02-24 14:35 [Bug fortran/39290] New: " burnus at gcc dot gnu dot org
2009-02-26 12:27 ` [Bug fortran/39290] " pault at gcc dot gnu 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-39290-4-oQXiaOGIbf@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).