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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org

--- Comment #15 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Mikael Morin from comment #14)

> I'm not sure this is actually correct; should we consider c(1) optional if c
> is optional?

We don't currently do this for the PRESENT intrinsic:

ig25@linux-fd1f:/tmp> cat opt.f90
module foo
contains
  subroutine opt(a)
    integer, intent(in), dimension(3) :: a
    if (present(a(1))) print *,a
  end subroutine opt
end module foo

program main
  use foo
  call opt
end program main
ig25@linux-fd1f:/tmp> gfortran opt.f90
opt.f90:5:16:

     if (present(a(1))) print *,a
                1
Error: »a« argument of »present« intrinsic at (1) must be of an OPTIONAL dummy
variable
opt.f90:10:6:

   use foo
      1
Fatal Error: Can't open module file »foo.mod« for reading at (1): Datei oder
Verzeichnis nicht gefunden
Kompilierung beendet.

Reply via email to