public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46100] New: Non-variable pointer expression as actual argument to INTENT(OUT) non-pointer dummy
@ 2010-10-20 16:44 burnus at gcc dot gnu.org
  2010-10-20 17:21 ` [Bug fortran/46100] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-10-20 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Non-variable pointer expression as actual argument to
                    INTENT(OUT) non-pointer dummy
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Reported at c.l.f by Thomas Jahns:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread
/a64e2f255466a87a

GNU Fortran (and most other compilers) reject passing a non-variable pointer
expression as actual argument to an INTENT(OUT)/INTENT(INOUT) non-pointer dummy
argument.

The reason for rejecting is that the pointer expression (i.e. a function
returning a pointer) itself is not definable. However, I believe now that it
the code is valid. Thus, only if the argument were a pointer dummy or the
expression were not a pointer expression, it would be invalid.

Example:

call one (two ())
contains
  subroutine one (x)
    integer, intent(inout) :: x
  end subroutine one
  function two ()
    integer, pointer :: two
    allocate(two)
  end function two
end

Error message:

call one (two ())
          1
Error: Non-variable expression in variable definition context (actual argument
to INTENT = OUT/INOUT) at (1)


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

end of thread, other threads:[~2010-10-21  6:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-20 16:44 [Bug fortran/46100] New: Non-variable pointer expression as actual argument to INTENT(OUT) non-pointer dummy burnus at gcc dot gnu.org
2010-10-20 17:21 ` [Bug fortran/46100] " burnus at gcc dot gnu.org
2010-10-20 17:45 ` [Bug fortran/46100] [Fortran 2008] " burnus at gcc dot gnu.org
2010-10-20 18:02 ` burnus at gcc dot gnu.org
2010-10-21  6:15 ` burnus at gcc dot gnu.org
2010-10-21  6:17 ` burnus 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).