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/41951] [OOP] Not diagnosing ambiguous operators (TB vs. INTERFACE)
Date: Fri, 16 Nov 2012 12:04:00 -0000	[thread overview]
Message-ID: <bug-41951-4-gJkWIAUh1q@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-41951-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #16 from janus at gcc dot gnu.org 2012-11-16 12:04:13 UTC ---
(In reply to comment #15)
> (In reply to comment #14)
> > Comment 12 is fixed with r189022, but comment 11 is still accepted without
> > error.

One way to reject the abstract case in comment 11, would be to just do the
checking, but not add the procedure to the operator list:


Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c    (revision 193552)
+++ gcc/fortran/resolve.c    (working copy)
@@ -11539,19 +11539,21 @@ resolve_typebound_intrinsic_op (gfc_symbol* derive
     goto error;

       /* Add target to non-typebound operator list.  */
-      if (!target->specific->deferred && !derived->attr.use_assoc
-      && p->access != ACCESS_PRIVATE)
+      if (!derived->attr.use_assoc && p->access != ACCESS_PRIVATE)
     {
-      gfc_interface *head, *intr;
       if (gfc_check_new_interface (derived->ns->op[op], target_proc,
                        p->where) == FAILURE)
         return FAILURE;
-      head = derived->ns->op[op];
-      intr = gfc_get_interface ();
-      intr->sym = target_proc;
-      intr->where = p->where;
-      intr->next = head;
-      derived->ns->op[op] = intr;
+      if (!target->specific->deferred)
+        {
+          gfc_interface *head, *intr;
+          head = derived->ns->op[op];
+          intr = gfc_get_interface ();
+          intr->sym = target_proc;
+          intr->where = p->where;
+          intr->next = head;
+          derived->ns->op[op] = intr;
+        }
     }
     }


  parent reply	other threads:[~2012-11-16 12:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-41951-4@http.gcc.gnu.org/bugzilla/>
2011-01-23 11:17 ` [Bug fortran/41951] [OOP] ICE in gfc_match_varspec, at fortran/primary.c:1815 tkoenig at gcc dot gnu.org
2011-01-23 13:02 ` dominiq at lps dot ens.fr
2011-12-12  8:07 ` burnus at gcc dot gnu.org
2011-12-12 13:29 ` burnus at gcc dot gnu.org
2011-12-13 12:04 ` burnus at gcc dot gnu.org
2011-12-16 14:32 ` burnus at gcc dot gnu.org
2012-01-17  8:49 ` [Bug fortran/41951] [OOP] Not diagnosing ambiguous operators (TB vs. INTERFACE) burnus at gcc dot gnu.org
2012-06-19 15:53 ` janus at gcc dot gnu.org
2012-06-23 13:54 ` janus at gcc dot gnu.org
2012-06-27 17:38 ` janus at gcc dot gnu.org
2012-06-27 17:54 ` janus at gcc dot gnu.org
2012-06-27 18:18 ` burnus at gcc dot gnu.org
2012-11-16 12:04 ` janus at gcc dot gnu.org [this message]
2012-11-16 12:33 ` 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-41951-4-gJkWIAUh1q@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).