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

--- Comment #21 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-26 
14:32:45 UTC ---
This comment is (just) for cross reference. The patch at
  http://gcc.gnu.org/ml/fortran/2011-11/msg00217.html
fixes some MOVE_ALLOC issues, including the following one.

Most of the examples in this PR are actually invalid as in MOVE_ALLOC either
both arguments shall be polymorphic or both nonpolymorphic.

For instance (comment 9):
>   class(bar), allocatable :: sm
>   type(bar2), allocatable :: sm2
>   call move_alloc(sm2,sm)
wrongly mixes them.

But also (comment 4):
  class(bar), allocatable :: sm,sm2
  select type(sm2) 
  type is (bar)
    call move_alloc(sm2,sm)
  end select
where "sm2" is nonpolymorphic due to the TYPE IS: Fortran 2008, 8.1.9.2, states
that "within the block following a TYPE IS type guard statement, the
associating entity (16.5.5) is not polymorphic"

Reply via email to