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 22:07:01 +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 #8 from janus at gcc dot gnu.org 2011-10-12 22:07:01 UTC ---
(In reply to comment #7)
> > 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)
>
> No, that version is *not* equivalent. In the previous example you have a
> *pointer intent*.
Well, comment #5 is 'equivalent' to comment #3: Both have a non-pointer intent
(which is what you suggested in your initial comment to my patch).
> In any case, the example of comment 5 is clearly invalid.
Ok, good that we agree on that at least ;)
By the same reasoning, comment #3 should be invalid, since they both do the
same thing wrt the argument 'dt' (namely deallocating its value component).