[Patch/gfortran] Fix for PR16939 - the testcase

Paul Thomas paulthomas2@wanadoo.fr
Mon May 9 20:24:00 GMT 2005


Herewith, the testscase:

! { dg-do run }
! This fixes PR16939, where pointer assignments of scalar,
! character pointers that are dummy arguments did not work.
! Contributed by Paul Thomas  pault@gcc.gnu.org
!
program char_pointer_assign_1
  character(len=4), pointer  :: a
  nullify (a)
  call foo (a)
  if ((.not.associated (a)).or.(a.ne."abcd")) call abort ()
contains
  subroutine foo (b)
    character(len=4), pointer :: b, c
    allocate (c)
    c = "abcd"
    b => c
  end subroutine foo
end program char_pointer_assign_1



More information about the Fortran mailing list