From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31376 invoked by alias); 28 Jun 2011 12:59:53 -0000 Received: (qmail 31366 invoked by uid 22791); 28 Jun 2011 12:59:53 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Jun 2011 12:59:37 +0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49562] [4.6/4.7 Regression] [OOP] assigning value to type-bound function X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: janus at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 28 Jun 2011 12:59:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg02737.txt.bz2 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) {