Patchwork [fortran] PR42385 - [OOP] poylmorphic operators do not work

login
register
mail settings
Submitter Paul Richard Thomas
Date July 19, 2010, 12:14 p.m.
Message ID <AANLkTil1AattKaR-KybBf83SYYLqRBdai6Q8K8G0mHzj@mail.gmail.com>
Download mbox | patch
Permalink /patch/59193/
State New
Headers show

Comments

Paul Richard Thomas - July 19, 2010, 12:14 p.m.
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
Jerry DeLisle - July 19, 2010, 1:05 p.m.
On 07/19/2010 05:14 AM, Paul Richard Thomas wrote:
> Tobias,
>
> try
> {
>> attachment
> }
> except
> {
>> ERROR STOP 'No patch found'
> }
>

I think this new bug reporting syntax could be habit forming.

Jerry

Patch

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);
 	    }