flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
230 stars 48 forks source link

Flang rejects valid code #1110

Open Romendakil opened 3 years ago

Romendakil commented 3 years ago

The following code below is valid and falsely rejected with the error message exceptions.f90:19:9: error: 'array=' argument has unacceptable rank 0 i = sum (maxloc (excs%level)) ^^^^^^^^^^^^^^^^^^^^^^^^^ /opt/local/libexec/llvm-11/bin/f18: semantic errors in exceptions.f90

(v11.1.0 on Darwin Big Sur)

module exceptions
  implicit none
  private
  public :: gather_exceptions

  integer, private, parameter :: NAME_LENGTH = 64
  type, public :: exception
     integer :: level = 0
     character(len=NAME_LENGTH) :: message = ""
     character(len=NAME_LENGTH) :: origin = ""
  end type exception

contains

  pure subroutine gather_exceptions (exc, excs)
    type(exception), intent(inout) :: exc
    type(exception), dimension(:), intent(in) :: excs
    integer :: i
    i = sum (maxloc (excs%level))
  end subroutine gather_exceptions
end module exceptions