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

            Bug ID: 103757
           Summary: compiler rejects import, {none,all,only}, does not
                    recognize the keyword
           Product: gcc
           Version: 10.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: b.j.braams at cwi dot nl
  Target Milestone: ---

The following code is rejected by gfortran 10.3.1 with an error message "Cannot
IMPORT ‘only’ from host scoping unit at (1) - does not exist." Same kind of
message if "import, all" or "import, none" is used. It seems that the compiler
is interpreting "all", "none" or "only" as objects to be imported rather than
as keywords.

module moo
  use iso_fortran_env, only : wp => real64
  implicit none ; private
  public :: foo
contains
  subroutine foo (fun)
    interface
       subroutine fun (x)
         import, only :: wp
         real (kind=wp) :: x
       end subroutine fun
    end interface
    return
  end subroutine foo
end module moo

Reply via email to