[Bug fortran/48699] [OOP] MOVE_ALLOC of polymorphic variables

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun May 15 12:00:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48699

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.05.15 11:47:17
     Ever Confirmed|0                           |1

--- Comment #4 from janus at gcc dot gnu.org 2011-05-15 11:47:17 UTC ---
(In reply to comment #0)
> [sfilippo@donald bug31]$ gfortran -c testmv2.f90
> testmv2.f90:38.20:
> 
>     call move_alloc(sm,dat%sm)
>                     1
> Error: 'from' argument of 'move_alloc' intrinsic at (1) must be ALLOCATABLE

Here is a reduced test case for this one:


program testmv2

  type bar
    integer, allocatable  :: ia(:), ja(:)
  end type bar

  class(bar), allocatable :: sm,sm2

  allocate(sm2)

  select type(sm2) 
  type is (bar)
    call move_alloc(sm2,sm)
  end select

end program testmv2


In each TYPE IS/CLASS IS block we generate a temporary for the selector.
Apparently we need to set the correct attributes for the temporary.



More information about the Gcc-bugs mailing list