This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR42385 - [OOP] poylmorphic operators do not work
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Jul 2010 14:14:10 +0200
- Subject: Re: [Patch, fortran] PR42385 - [OOP] poylmorphic operators do not work
- References: <20100719093228.GA28124@physik.fu-berlin.de>
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);
}