"12.5.2.12 Argument presence and restrictions on arguments not present

A dummy argument or an entity that is host associated with a dummy argument is
not present if the dummy argument
[...]
* does not have the ALLOCATABLE or POINTER attribute, and corresponds to an
  actual argument that
  - has the ALLOCATABLE attribute and is not allocated, or
  - has the POINTER attribute and is disassociated."

That probably means:

a) NULL(mold) as actual argument is allowed
b) For scalars, it should just work
c) For arguments with descriptors, one needs to add:
   (actual.data == NULL) ? NULL : actual


-- 
           Summary: [F2008] Passing NULL pointer or unallocated allocatable
                    to OPTIONAL dummy
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          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=44666

Reply via email to