I was speaking of the dynamic type.
class(animal_t), pointer :: john, clone
allocate(spider_t :: john)
clone => john
call fetch_ptr(john) ! john becomes undefined on entry
! the target and hence the dynamic type are lost
! clone changes too
If these were integers, everything would be fine (although it can potentially cause a memory leak, break associations, and is discouraged stylistically).
I’m just trying to play devil’s advocate here. Correct me if I’m wrong, but you are suggesting an amendment (in bold):
C1587 An INTENT (OUT) dummy argument of a pure procedure that is not a pointer, shall not be polymorphic or have a polymorphic allocatable ultimate component.