Skip to content

Flang rejects valid code #1110

Description

@Romendakil

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions