public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/35476]  New: Accepts invalid: USE/host association of generics with same specifics
Date: Wed, 05 Mar 2008 17:46:00 -0000	[thread overview]
Message-ID: <bug-35476-13404@http.gcc.gnu.org/bugzilla/> (raw)

Found the following on the J3 Fortran list. I think the program below is
invalid for the reasons given by Bill Long, but it has not finally decided yet
(on J3). (The question/program comes from Sun)

Current status:
- openf95 and sunf95 reject it
- ifort, gfortran, NAG f95, and g95 accept it
Bill Long writes that he tested two non-Sun compilers, of which two gave an
error and two did not.

Craig diged up from the standard:
| Use association is defined in section 11.2.1.  Host association is
| covered in section 16.4.1.3.  The second paragraph starts with this sentence
| [411:9-10]:  "If an entity that is accessed by use association has the same
| nongeneric name as a host entity, the host entity is inaccessible by that
| name."

However, as Bill notes:
| I think that issuing the error is valid.  Generic interfaces merge 
| together their lists of specifics when more than one with the same 
| generic name is visible.  Whether that visibility comes through host 
| association or use association should not matter.  Craig's citation from 
| f03 explicitly says "nongeneric" intentionally, and does not apply in 
| this case.

       MODULE M1
         INTERFACE SUBR
           MODULE PROCEDURE SUBR1
         END INTERFACE
       CONTAINS
         SUBROUTINE SUBR1
         END SUBROUTINE
       END

       MODULE M2
         INTERFACE SUBR
           MODULE PROCEDURE SUBR2
         END INTERFACE
       CONTAINS
         SUBROUTINE SUBR2
         END SUBROUTINE
       END

       PROGRAM MAIN
         USE M1
         CALL S
       CONTAINS
         SUBROUTINE S
           USE M2
           CALL SUBR
         END SUBROUTINE
       END


-- 
           Summary: Accepts invalid: USE/host association of generics with
                    same specifics
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


             reply	other threads:[~2008-03-05 17:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 17:46 burnus at gcc dot gnu dot org [this message]
2008-03-05 22:06 ` [Bug fortran/35476] " pault at gcc dot gnu dot org
2008-03-06  7:01 ` burnus at gcc dot gnu dot org
2008-03-07 12:04 ` fxcoudert at gcc dot gnu dot org
2008-03-15 22:41 ` pault at gcc dot gnu dot org
2008-04-12 10:34 ` burnus at gcc dot gnu dot org
2009-02-11 15:11 ` pault at gcc dot gnu dot org
2009-02-11 15:36 ` burnus at gcc dot gnu dot org
2009-12-17 22:50 ` burnus 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-35476-13404@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).