public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50570] New: Incorrect error for assignment to intent(in) pointer
@ 2011-09-29 19:28 longb at cray dot com
  2011-09-30  7:00 ` [Bug fortran/50570] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: longb at cray dot com @ 2011-09-29 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50570
           Summary: Incorrect error for assignment to intent(in) pointer
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: longb@cray.com


> cat test.f90
program bots_sparselu_pointer_intent_in
! derived from Fortran trans of BOTS sparselu

  implicit none
  integer, pointer :: array(:)

  allocate(array(4))
  array = 0
  call sub(array)
  write (*,*) SUM(array)

contains

  subroutine sub(dummy)
     integer, pointer, intent(in) :: dummy(:)
     dummy(1) = 1 ! note that gfortran 4.6.1 accepts "dummy = 1"
  end subroutine sub

end program bots_sparselu_pointer_intent_in

> gfortran -c test.f90
test.f90:16.5:

     dummy(1) = 1 ! note that gfortran 4.6.1 accepts "dummy = 1"
     1
Error: Dummy argument 'dummy' with INTENT(IN) in variable definition context
(assignment) at (1)



This should compile.  In the case of a POINTER dummy, the INTENT(IN) applies to
the pointer association status, not definition of the target.

Appears to be a regression, as 4.5.3 was OK.


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

end of thread, other threads:[~2011-10-15 13:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-29 19:28 [Bug fortran/50570] New: Incorrect error for assignment to intent(in) pointer longb at cray dot com
2011-09-30  7:00 ` [Bug fortran/50570] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
2011-10-03 10:15 ` msteghofer at cistib dot upf.edu
2011-10-03 10:17 ` msteghofer at cistib dot upf.edu
2011-10-09 20:32 ` janus at gcc dot gnu.org
2011-10-09 20:40 ` burnus at gcc dot gnu.org
2011-10-09 21:15 ` janus at gcc dot gnu.org
2011-10-09 23:08 ` janus at gcc dot gnu.org
2011-10-09 23:28 ` janus at gcc dot gnu.org
2011-10-10  6:58 ` burnus at gcc dot gnu.org
2011-10-10  9:45 ` msteghofer at cistib dot upf.edu
2011-10-10 11:48 ` janus at gcc dot gnu.org
2011-10-10 13:25 ` msteghofer at cistib dot upf.edu
2011-10-10 15:17 ` rguenth at gcc dot gnu.org
2011-10-14 17:59 ` janus at gcc dot gnu.org
2011-10-15 13:31 ` janus at gcc dot gnu.org
2011-10-15 13:32 ` janus at gcc dot gnu.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).