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/45740] PROCEDURE POINTER and PROTECTED: Accepts/ICEs on invalid code
Date: Sat, 02 Oct 2010 18:51:00 -0000	[thread overview]
Message-ID: <20101002185100.CSyVSggO33a6C5OFnE2MbibSur0WYl5yoweUdulZ6rQ@z> (raw)
In-Reply-To: <bug-45740-4@http.gcc.gnu.org/bugzilla/>

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

janus at gcc dot gnu.org changed:

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

--- Comment #8 from janus at gcc dot gnu.org 2010-10-02 18:51:21 UTC ---
Patch:


Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c    (revision 164900)
+++ gcc/fortran/expr.c    (working copy)
@@ -3250,6 +3250,14 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_ex
       return FAILURE;
     }

+  /* Check for F08:C551.  */
+  if (rvalue->expr_type == EXPR_VARIABLE
+      && rvalue->symtree->n.sym->attr.is_protected
+      && rvalue->symtree->n.sym->attr.use_assoc)
+    gfc_error ("Variable '%s' is PROTECTED and can not appear in a "
+           "pointer assignment statement at %L",
+           rvalue->symtree->n.sym->name, &rvalue->where);
+
   proc_pointer = lvalue->symtree->n.sym->attr.proc_pointer;

   rank_remap = false;


  parent reply	other threads:[~2010-10-02 18:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-45740-4@http.gcc.gnu.org/bugzilla/>
2010-10-02 11:34 ` burnus at gcc dot gnu.org
2010-10-02 13:25 ` janus at gcc dot gnu.org
2010-10-02 14:19 ` janus at gcc dot gnu.org
2010-10-02 14:39 ` burnus at gcc dot gnu.org
2010-10-02 15:25 ` janus at gcc dot gnu.org
2010-10-02 18:51 ` janus at gcc dot gnu.org [this message]
2010-10-02 19:52 ` burnus at gcc dot gnu.org
2010-10-03 20:25 ` janus at gcc dot gnu.org
2010-09-21 12:32 [Bug fortran/45740] New: " burnus at gcc dot gnu dot org
2010-09-21 13:47 ` [Bug fortran/45740] " burnus at gcc dot gnu dot org
2010-09-21 14:20 ` burnus at gcc dot gnu dot 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=20101002185100.CSyVSggO33a6C5OFnE2MbibSur0WYl5yoweUdulZ6rQ@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).