public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus 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: Mon, 29 Apr 2013 09:31:00 -0000	[thread overview]
Message-ID: <bug-39290-4-8VGhwnR0LT@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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-04-29 09:31:53 UTC ---
(In reply to comment #6)
>   external ff, cc
>   call q(ff)
>
> 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?

The program is *valid*; as "ff" is referenced as function, it has to be
implicitly typed, which is "real" according to the implicit typing rules.

I concur that the standard does not very explicitly state this. But the
question (and example of comment 4) exactly matches the interpretation request
F03/0071 (cf. comment 0). J3/WG5 answered it
http://www.j3-fortran.org/doc/standing/links/016.txt - to quote from the answer
to Q2:

"2. The main program program unit is conforming, although the program
    would not be if the external procedure FF were not in fact a real
    function.  If the reference had been to QR instead of Q, it would
    be clear that FF has to be a real function, from the point of view
    of the main program scoping unit.  At the call site, the reference
    to Q is known to be a reference either to QR or QC (the interface
    block for Q is not defective), both of which require a function
    actual argument.  FF is known to be either a subroutine or a
    function, since it explicitly has the EXTERNAL attribute, and if
    it is a function it is known by implicit typing rules to be real.
    Because neither specific in the generic allows a subroutine as an
    argument, FF must therefore be a function.  Since FF is real, QR
    is called.  (The generic cannot have a specific that accepts a
    subroutine as an argument, as that would violate the requirements
    in 16.2.3.)"


  parent reply	other threads:[~2013-04-29  9:31 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
2013-04-29  9:31 ` burnus at gcc dot gnu.org [this message]
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-8VGhwnR0LT@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).