This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50684] [4.6/4.7 Regression] Incorrect error for move_alloc on element inside intent(in) pointer
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Oct 2011 21:17:58 +0000
- Subject: [Bug fortran/50684] [4.6/4.7 Regression] Incorrect error for move_alloc on element inside intent(in) pointer
- Auto-submitted: auto-generated
- References: <bug-50684-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50684
--- Comment #5 from janus at gcc dot gnu.org 2011-10-12 21:17:58 UTC ---
(In reply to comment #4)
> > This was rejected before, and still is with my patch.
>
> But should it be rejected? move_alloc does not modify the association status of
> "dt" - just of "dt%VALUE". Thus, I believe this test case is valid and, hence,
> gfortran should not reject it.
Huh, seems I misunderstood your comment.
I can't give any hard evidence right now, but naively I would say it should
indeed be rejected. Shouldn't the allocation status of the components be
protected by the "intent(in)"?
The following (equivalent) variant is at least rejected by gfortran 4.5 on
upwards:
TYPE MY_TYPE
INTEGER, ALLOCATABLE :: VALUE
END TYPE
CONTAINS
SUBROUTINE sub (dt)
type(MY_TYPE), intent(in) :: dt
deallocate(dt%VALUE)
END SUBROUTINE
end
deallocate(dt%VALUE)
1
Error: Dummy argument 'dt' with INTENT(IN) in variable definition context
(DEALLOCATE object) at (1)