Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flang rejects valid code #1110

Open
Romendakil opened this issue May 17, 2021 · 0 comments
Open

Flang rejects valid code #1110

Romendakil opened this issue May 17, 2021 · 0 comments

Comments

@Romendakil
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant