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/47710] [OOP] Improve ambiguity check for TBP
Date: Sat, 12 Feb 2011 10:05:00 -0000	[thread overview]
Message-ID: <bug-47710-4-H2Q0Mmh898@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47710-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47710

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-12 09:47:53 UTC ---
The first example is rejected by ifort (12.0? with a warning - but works) and
NAG (5.1, 5.2? - error); crayftn and gfortran accept it.
The second example by Janus is accepted by gfortran, NAG 5.1 (both call
baseproc1) and by Crayftn (calls baseproc2) - I have not checked with ifort 12
(ifort 11.1 does not support TBP GENERIC).
(Both programs are rejected by PGI 10.5 at a different place which looks like a
compiler bug.)

 * * *

In Fortran 2008, this is covered by C1215 in "12.4.3.4.5 Restrictions on
generic declarations".

To valid, a program needs to fulfil one of the items (1) to (3); I agree with
Richard Maine that the following should be fulfilled for the first program:

"(1) there is a non-passed-object dummy data object in one or the
 other of them such that
    (a) the number of dummy data objects in one that are nonoptional,
        are not passed-object, and with which that dummy data object is TKR
        compatible, possibly including that dummy data object itself,
    exceeds
    (b) the number of non-passed-object dummy data objects, both optional
        and nonoptional, in the other that are not distinguishable from
        that dummy data object,"

"baseproc_nopass" has *one* nonoptional "non-passed-object dummy" this exceeds
the number of "non-passed-object dummy data objects" of "baseproc_pass", which
has no non-passed-object dummy. Hence, the program should be valid.

For Janus's program, both have exactly the same number of non-passed-object
dummies: Namely one. "(2)" does not apply as only one has "pass" and "(3)" also
does not seem to be fulfilable. Hence, the program should be invalid.


  reply	other threads:[~2011-02-12  9:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-12  9:32 [Bug fortran/47710] New: " burnus at gcc dot gnu.org
2011-02-12 10:05 ` burnus at gcc dot gnu.org [this message]
2011-09-10  8:48 ` [Bug fortran/47710] [OOP] Improve ambiguity check for GENERIC TBP w/ PASS and NOPASS janus at gcc dot gnu.org
2011-09-10  9:45 ` janus at gcc dot gnu.org
2012-06-17 17:47 ` janus at gcc dot gnu.org
2012-06-17 21:28 ` janus at gcc dot gnu.org
2012-06-22 21:06 ` janus at gcc dot gnu.org
2012-06-22 21:17 ` janus at gcc dot gnu.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-47710-4-H2Q0Mmh898@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).