https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104819

            Bug ID: 104819
           Summary: Reject NULL without MOLD as actual to an assumed-rank
                    dummy
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

[Found when looking at PR 104126]
Cf. https://mailman.j3-fortran.org/pipermail/j3/2022-March/013584.html

   call foo(null())
contains
   subroutine foo(x)
     integer, pointer, intent(in) :: x(..)
     print *, rank(x)
   end subroutine
end

I believe this should be rejected as the rank is not known without a MOLD.

 * * *

The following is also invalid because of
  "If any type parameters of the contextual entity are assumed, MOLD shall be
present."
("16.9.155 NULL ([MOLD])"):

call foo(null())
contains
   subroutine foo(x)
     character(len=*), pointer, intent(in) :: x
   end subroutine
end

Reply via email to