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/49562] [4.6/4.7 Regression] [OOP] assigning value to type-bound function
Date: Tue, 28 Jun 2011 12:59:00 -0000	[thread overview]
Message-ID: <bug-49562-4-aRDCLXx3b5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49562-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from janus at gcc dot gnu.org 2011-06-28 12:59:20 UTC ---
(In reply to comment #5)
> Unfortunately this test case is rejected with the patch in comment #2.

However, it is accepted with this improved patch:


Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c    (revision 175580)
+++ gcc/fortran/expr.c    (working copy)
@@ -4394,8 +4394,8 @@ gfc_check_vardef_context (gfc_expr* e, bool pointe
       sym = e->value.function.esym ? e->value.function.esym :
e->symtree->n.sym;
     }

-  if (!pointer && e->expr_type == EXPR_FUNCTION
-      && sym->result->attr.pointer)
+  attr = gfc_expr_attr (e);
+  if (!pointer && e->expr_type == EXPR_FUNCTION && attr.pointer)
     {
       if (!(gfc_option.allow_std & GFC_STD_F2008))
     {
@@ -4432,7 +4432,6 @@ gfc_check_vardef_context (gfc_expr* e, bool pointe

   /* Find out whether the expr is a pointer; this also means following
      component references to the last one.  */
-  attr = gfc_expr_attr (e);
   is_pointer = (attr.pointer || attr.proc_pointer);
   if (pointer && !is_pointer)
     {


  parent reply	other threads:[~2011-06-28 12:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28  8:26 [Bug fortran/49562] New: [OOP] ICE at invalid code: assigning value to function of polymorphic object boschmann at tp1 dot physik.uni-siegen.de
2011-06-28  9:43 ` [Bug fortran/49562] [4.6/4.7 Regression] " janus at gcc dot gnu.org
2011-06-28 11:05 ` janus at gcc dot gnu.org
2011-06-28 11:06 ` janus at gcc dot gnu.org
2011-06-28 11:19 ` janus at gcc dot gnu.org
2011-06-28 12:53 ` [Bug fortran/49562] [4.6/4.7 Regression] [OOP] assigning value to type-bound function janus at gcc dot gnu.org
2011-06-28 12:59 ` janus at gcc dot gnu.org [this message]
2011-07-02 11:09 ` janus at gcc dot gnu.org
2011-07-09 18:38 ` burnus at gcc dot gnu.org
2011-07-10  9:32 ` janus at gcc dot gnu.org
2011-07-10 11:50 ` janus at gcc dot gnu.org
2011-07-10 11:53 ` 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-49562-4-aRDCLXx3b5@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).