[RFC] Polymorphic deep copy (aka PR46174)
Janus Weil
janus@gcc.gnu.org
Thu Nov 4 21:52:00 GMT 2010
Hi all,
> Attached is an updated version of the patch which fixes the original
> test case (but is not yet perfect in all details).
here is another update of this patch. I'm settling for the $copy part
for now, leaving the $free for a follow-up.
Also I have weeded out a couple of regressions and am left with only a
single one: class_defined_operator_1.f03 aborts at run-time. It has
several abort()'s and fails already at the first one, where the result
is now -42 instead of +42.
The reason for this is that the "ALLOCATE with SOURCE" statement now
makes use of the defined assignment operator for copying the source,
which introduces the additional minus sign. I am not completely sure
if this behavior is ok and was not able to pinpoint it in the standard
so far. Can anyone tell me if ALLOCATE w/ SOURCE is actually supposed
to use the defined OPERATOR(=) or not? (May naive guess is that it
should, i.e. behaving like an assignment statement. But I might be
wrong.)
Apart from this issue I think the patch should be pretty close to
being committable. Any comments?
Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr46174_copy.diff
Type: application/octet-stream
Size: 8933 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20101104/e47c83b0/attachment.obj>
More information about the Fortran
mailing list