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/45521] [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
Date: Fri, 20 Apr 2012 12:59:00 -0000	[thread overview]
Message-ID: <bug-45521-4-YItPhbCA17@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-45521-4@http.gcc.gnu.org/bugzilla/>

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #12 from janus at gcc dot gnu.org 2012-04-20 12:58:24 UTC ---
(In reply to comment #11)
> For for former, we clearly need to add a check in 'compare_parameter' to
> reject it


Something like:

Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c    (revision 186596)
+++ gcc/fortran/interface.c    (working copy)
@@ -1663,6 +1667,13 @@ compare_parameter (gfc_symbol *formal, gfc_expr *a
        the module variables are generated.  */
     gfc_find_derived_vtab (actual->ts.u.derived);

+  if (formal->attr.flavor == FL_PROCEDURE && actual->ts.type != BT_PROCEDURE)
+    {
+      if (where)
+    gfc_error ("Procedure argument expected at %L", &actual->where);
+      return 0;
+    }
+  
   if (actual->ts.type == BT_PROCEDURE)
     {
       char err[200];


This correctly rejects the invalid code in comment #11 and makes the valid code
in comment #10 give the expected output (without segfaulting).


  parent reply	other threads:[~2012-04-20 12:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-45521-4@http.gcc.gnu.org/bugzilla/>
2012-01-02 22:39 ` [Bug fortran/45521] Fortran 2008: " burnus at gcc dot gnu.org
2012-04-18 19:19 ` [Bug fortran/45521] [F08] " janus at gcc dot gnu.org
2012-04-18 19:40 ` janus at gcc dot gnu.org
2012-04-19 12:46 ` janus at gcc dot gnu.org
2012-04-19 12:55 ` janus at gcc dot gnu.org
2012-04-19 13:06 ` janus at gcc dot gnu.org
2012-04-19 13:16 ` burnus at gcc dot gnu.org
2012-04-19 13:25 ` wangmianzhi1 at linuxmail dot org
2012-04-19 13:37 ` wangmianzhi1 at linuxmail dot org
2012-04-19 13:39 ` janus at gcc dot gnu.org
2012-04-20 12:29 ` janus at gcc dot gnu.org
2012-04-20 12:59 ` janus at gcc dot gnu.org [this message]
2012-04-25 12:30 ` janus at gcc dot gnu.org
2012-10-06 12:20 ` janus at gcc dot gnu.org
2012-10-06 12:35 ` 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-45521-4-YItPhbCA17@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).