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/47978] [OOP] Invalid INTENT in overriding TBP not detected
Date: Thu, 08 Sep 2011 14:57:00 -0000	[thread overview]
Message-ID: <bug-47978-4-znGqI81nP7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47978-4@http.gcc.gnu.org/bugzilla/>

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-09-08
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #3 from janus at gcc dot gnu.org 2011-09-08 14:47:09 UTC ---
Preliminary patch:

Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c     (revision 178664)
+++ gcc/fortran/interface.c     (working copy)
@@ -3643,11 +3643,19 @@ gfc_check_typebound_override (gfc_symtree* proc, g
       if (proc_pass_arg != argpos && old_pass_arg != argpos
          && !gfc_compare_types (&proc_formal->sym->ts, &old_formal->sym->ts))
        {
-         gfc_error ("Types mismatch for dummy argument '%s' of '%s' %L "
-                    "in respect to the overridden procedure",
+         gfc_error ("Types mismatch for dummy argument '%s' of '%s' at %L "
+                    "with respect to the overridden procedure",
                     proc_formal->sym->name, proc->name, &where);
          return FAILURE;
        }
+      /* Check INTENT.  */
+      if (proc_formal->sym->attr.intent != old_formal->sym->attr.intent)
+       {
+         gfc_error ("INTENT mismatch in argument '%s' of '%s' at %L "
+                    "with respect to the overridden procedure",
+                    proc_formal->sym->name, proc->name, &where);
+         return FAILURE;
+       }

       ++argpos;
     }


  parent reply	other threads:[~2011-09-08 14:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 16:44 [Bug fortran/47978] New: " sfilippone at uniroma2 dot it
2011-03-03 16:47 ` [Bug fortran/47978] " sfilippone at uniroma2 dot it
2011-03-04  7:11 ` burnus at gcc dot gnu.org
2011-09-08 14:57 ` janus at gcc dot gnu.org [this message]
2011-09-10 12:32 ` janus at gcc dot gnu.org
2011-09-11 20:25 ` janus at gcc dot gnu.org
2011-09-11 20:29 ` janus at gcc dot gnu.org
2011-09-14 13:37 ` dominiq at lps dot ens.fr
2011-09-14 13:49 ` sfilippone at uniroma2 dot it
2011-09-14 13:54 ` sfilippone at uniroma2 dot it
2011-09-14 13:57 ` janus at gcc dot gnu.org
2011-09-14 14:08 ` janus at gcc dot gnu.org
2011-09-14 15:12 ` sfilippone at uniroma2 dot it

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-47978-4-znGqI81nP7@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).