summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-19 18:48:44 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-19 18:48:44 +0000
commitabca35418102c31d95b688897b34b9ff2688ee3d (patch)
treedcccbe076c70bfa184d4951d084dc40709a025ab /gcc/fortran/trans-decl.c
parent2259c4d55916f89cdfa0610788e0330e142cedb7 (diff)
downloadgcc-abca35418102c31d95b688897b34b9ff2688ee3d.tar.gz
2010-07-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/42385 * interface.c (matching_typebound_op): Add argument for the return of the generic name for the procedure. (build_compcall_for_operator): Add an argument for the generic name of an operator procedure and supply it to the expression. (gfc_extend_expr, gfc_extend_assign): Use the generic name in calls to the above procedures. * resolve.c (resolve_typebound_function): Catch procedure component calls for CLASS objects, check that the vtable is complete and insert the $vptr and procedure components, to make the call. (resolve_typebound_function): The same. * trans-decl.c (gfc_trans_deferred_vars): Do not deallocate an allocatable scalar if it is a result. 2010-07-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/42385 * gfortran.dg/class_defined_operator_1.f03 : New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162313 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index bd7363d933d..5932695a587 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3249,9 +3249,10 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
/* Deallocate when leaving the scope. Nullifying is not
needed. */
- tmp = gfc_deallocate_with_status (se.expr, NULL_TREE, true,
- NULL);
-
+ tmp = NULL;
+ 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);
}
}