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/46161] [OOP] Invalid: Passing non-polymorphic to allocatable polymorphic dummy
Date: Tue, 26 Oct 2010 13:04:00 -0000	[thread overview]
Message-ID: <20101026130400.4b21tbOou9CFB28rYvVS6d6HiLT_gFT8202gfnT7yIg@z> (raw)
In-Reply-To: <bug-46161-4@http.gcc.gnu.org/bugzilla/>

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.10.26 13:04:05
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org 2010-10-26 13:04:05 UTC ---
Preliminary patch:


Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c     (revision 165936)
+++ gcc/fortran/interface.c     (working copy)
@@ -1519,6 +1520,18 @@ compare_parameter (gfc_symbol *formal, gfc_expr *a
                   gfc_typename (&formal->ts));
       return 0;
     }
+    
+  /* F2003, 12.5.2.5.  */
+  if (formal->ts.type == BT_CLASS
+      && (CLASS_DATA (formal)->attr.pointer
+          || CLASS_DATA (formal)->attr.allocatable)
+      && actual->ts.type != BT_CLASS)
+    {
+      if (where)
+       gfc_error ("Actual argument to '%s' at %L must be polymorphic",
+                   formal->name, &actual->where);
+      return 0;
+    }

   if (formal->attr.codimension)
     {


  reply	other threads:[~2010-10-26 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-24 22:28 [Bug fortran/46161] New: " burnus at gcc dot gnu.org
2010-10-26 13:04 ` janus at gcc dot gnu.org [this message]
2010-10-27 21:42 ` [Bug fortran/46161] " janus at gcc dot gnu.org
2010-10-27 21:42 ` 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=20101026130400.4b21tbOou9CFB28rYvVS6d6HiLT_gFT8202gfnT7yIg@z \
    --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).