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

            Bug ID: 106035
           Summary: F2018 allows an IMPORT statement within the BLOCK
                    construct.
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kargl at gcc dot gnu.org
  Target Milestone: ---

% cat a.f90
program bug
   implicit none
   integer i
   i = 42
   block
      import none  ! <-- This is valid Fortran 2018
      integer j
      j = 12
      print *, j
   end block
   print *, i
end program bug

% gfortran -c a.f90
a.f90:6:13:

    6 |       import none
      |             1
Error: IMPORT statement at (1) only permitted in an INTERFACE body

Reply via email to