From patchwork Mon Jul 19 12:14:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Richard Thomas X-Patchwork-Id: 59193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A2C9C1007D7 for ; Mon, 19 Jul 2010 22:14:27 +1000 (EST) Received: (qmail 5721 invoked by alias); 19 Jul 2010 12:14:23 -0000 Received: (qmail 5699 invoked by uid 22791); 19 Jul 2010 12:14:21 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-fx0-f47.google.com (HELO mail-fx0-f47.google.com) (209.85.161.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Jul 2010 12:14:13 +0000 Received: by fxm12 with SMTP id 12so2698561fxm.20 for ; Mon, 19 Jul 2010 05:14:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.240.11 with SMTP id s11mr329466mur.79.1279541650857; Mon, 19 Jul 2010 05:14:10 -0700 (PDT) Received: by 10.103.8.15 with HTTP; Mon, 19 Jul 2010 05:14:10 -0700 (PDT) In-Reply-To: <20100719093228.GA28124@physik.fu-berlin.de> References: <20100719093228.GA28124@physik.fu-berlin.de> Date: Mon, 19 Jul 2010 14:14:10 +0200 Message-ID: Subject: Re: [Patch, fortran] PR42385 - [OOP] poylmorphic operators do not work From: Paul Richard Thomas To: Tobias Burnus Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Tobias, try { > attachment } except { > ERROR STOP 'No patch found' } > >> The attached patch implements defined operators for CLASS objects. >> Boostrapped and regtested on x86_64/FC9 - OK for trunk? > > That part of the patch looks OK. Good; except the testcase doesn't work without the missing bit..... > > Thanks! Thanks to you and Dominique for the reviews. Cheers Paul Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (revision 162294) +++ gcc/fortran/trans-decl.c (working copy) @@ -3249,8 +3249,10 @@ /* Deallocate when leaving the scope. Nullifying is not needed. */ - tmp = gfc_deallocate_with_status (se.expr, NULL_TREE, true, - NULL); + tmp = NULL_TREE; + if (!sym->attr.result) + tmp = gfc_deallocate_with_status (se.expr, NULL_TREE, + true, NULL); gfc_add_init_cleanup (&try_block, gfc_finish_block (&init), tmp); }