public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41872]  New: wrong-code: No auto-deallocation for INTENT(OUT) allocatable scalars
@ 2009-10-29 21:58 burnus at gcc dot gnu dot org
  2009-10-29 22:52 ` [Bug fortran/41872] " burnus at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-10-29 21:58 UTC (permalink / raw)
  To: gcc-bugs

The following programs shows that the automatic deallocation is not applied to
allocatable INTENT(OUT) scalar dummies. It works for array arguments.

Note: For optional arguments, one needs to make sure that the deallocation only
happens if the variable is present, cf. PR 41850.

program test
  implicit none
  integer, allocatable :: a
  allocate(a)
  call foo(a)
  if(.not. allocated(a)) call abort()
  if (a /= 5) call abort()
contains
  subroutine foo(a)
    integer, allocatable, intent(out) :: a
    if(allocated(a)) call abort()
    allocate(a)
    a = 5
  end subroutine foo
end program test


-- 
           Summary: wrong-code: No auto-deallocation for INTENT(OUT)
                    allocatable scalars
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-01-07  8:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-29 21:58 [Bug fortran/41872] New: wrong-code: No auto-deallocation for INTENT(OUT) allocatable scalars burnus at gcc dot gnu dot org
2009-10-29 22:52 ` [Bug fortran/41872] " burnus at gcc dot gnu dot org
2009-10-30 22:26 ` burnus at gcc dot gnu dot org
2009-11-01 16:08 ` [Bug fortran/41872] wrong-code: Issues with " burnus at gcc dot gnu dot org
2009-11-01 17:47 ` burnus at gcc dot gnu dot org
2009-11-01 20:47 ` burnus at gcc dot gnu dot org
2009-12-15  3:02 ` jvdelisle at gcc dot gnu dot org
2009-12-30  0:20 ` burnus at gcc dot gnu dot org
2009-12-30 20:50 ` burnus at gcc dot gnu dot org
2010-01-04  7:31 ` burnus at gcc dot gnu dot org
2010-01-04  7:43 ` burnus at gcc dot gnu dot org
2010-01-05  7:19 ` burnus at gcc dot gnu dot org
2010-01-07  8:10 ` burnus at gcc dot gnu dot org
2010-01-07  8:12 ` burnus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).