(Belongs to the features already implemented in several compilers, including
ifort, g95, NAG f95, absoft)

The INTENT applies to the value of the pointer, not the thing being pointed to.

Main points (from 5.1.2.7):

The INTENT (IN) attribute for a pointer dummy argument specifies that during
the execution of the procedure its association shall not be changed except that
it may become undefined if the target is deallocated other than through the
pointer.

The INTENT (OUT) attribute for a pointer dummy argument specifies that on
invocation of the procedure the pointer association status of the dummy
argument becomes undefined. Any actual argument associated with such a pointer
dummy shall be a pointer variable.

The INTENT (INOUT) attribute for a pointer dummy argument specifies that it is
intended for use both to receive a pointer association from and to return a
pointer association to the invoking scoping unit. Any actual argument
associated with such a pointer dummy shall be a pointer variable.


If a dummy argument is a derived-type object with a pointer component, then the
pointer as a pointer is a subobject of the dummy argument, but the target of
the pointer is not. Therefore, the restrictions on subobjects of the dummy
object apply to the pointer in contexts where it is used as a pointer, but not
in contexts where it is dereferenced to indicate its target.

Similarly, the INTENT restrictions on pointer dummy arguments apply only to the
association of the dummy argument; they do not restrict the operations allowed
on its target.

A pointer object with the INTENT (IN) attribute shall not appear as
(1) A pointer-object in a nullify-stmt,
(2) A data-pointer-object or proc-pointer-object in a pointer-assignment-stmt,
(3) An allocate-object in an allocate-stmt or deallocate-stmt, or
(4) An actual argument in a reference to a procedure if the associated dummy
argument is a pointer with the INTENT (OUT) or INTENT (INOUT) attribute.


-- 
           Summary: Fortran 2003: Support intent for pointers
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          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=29624

Reply via email to