[Patch, fortran] PR42385 - [OOP] poylmorphic operators do not work
Paul Richard Thomas
paul.richard.thomas@gmail.com
Sun Jul 18 18:05:00 GMT 2010
The attached patch implements defined operators for CLASS objects.
Along the way, I correct a buglet that nullified allocatable scalar
results, thereby causing the testcase to fail.
Boostrapped and regtested on x86_64/FC9 - OK for trunk?
Paul
2010-07-18 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-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/42385
* gfortran.dg/class_defined_operator_1.f03 : New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-diff
Size: 12532 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100718/87682c04/attachment.bin>
More information about the Gcc-patches
mailing list