Hi Harald,

I have taken gcc-patches out of the loop for now :-)

I am really sorry to be such a bother, but before we think we should
> do the same as Intel, we need to understand what Intel does and whether
> that is actually correct.  Or not inconsistent with the standard.
> And I would really like to understand even the most simple, stupid case.
>

You are not being a bother. I am happy that you are taking an interest.

....snip....
>


> So my stupid questions are:
>
> - is ThyType invoking a constructor?  It is a parameter, after all.
>    Should using it in an assignment invoke a destructor?  If so why?
>
>    And why does Intel then increment the final_count?
>
> - is the initialization of ThyType2 invoking a constructor?
>    It might, if that is the implementation in the compiler, but
>    should there be a finalization?
>
>
7.5.6.3 When finalization occurs
1 When an intrinsic assignment statement is executed (10.2.1.3), if the
variable is not an unallocated allocatable
variable, it is finalized after evaluation of expr and before the
definition of the variable. If the variable is an
allocated allocatable variable, or has an allocated allocatable subobject,
that would be deallocated by intrinsic
assignment, the finalization occurs before the deallocation.

Your "stupid questions" are not at all stupid. The finalization of
'variable' that occurs in your testcase demonstrates that the finalization
with my patch is occurring at the wrong time. I now see that NAG is correct
on this.

Please press on with the questions!

Regards

Paul

Reply via email to