https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119800

kargls at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargls at comcast dot net

--- Comment #1 from kargls at comcast dot net ---
(In reply to Keith Refson from comment #0)

> 
> I suggest at least issuing a warning to expect undefined run-time behaviour!
>

Here's a patch hidden behind -Wsurprising.

% gfcx -o z -Wsurprising a.f90
a.f90:10:19:

   10 |       b = transfer(a, b)
      |                   1
Warning: SOURCE at (1) contains an ALLOCATABLE or POINTER component, which may
lead to undefined behavior because TRANSFER does not do a deep copy
[-Wsurprising]


It's a partial patch in that it only handles SOURCE with a derived type.
The patch likely needs to be expanded to handle a polymorphic entity. 
I know very little about CLASS.

Reply via email to