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] Usage of assumed rank variable as a dummy argument #74285

Closed
NimishMishra opened this issue Dec 4, 2023 · 2 comments · Fixed by #74286
Closed

[flang] Usage of assumed rank variable as a dummy argument #74285

NimishMishra opened this issue Dec 4, 2023 · 2 comments · Fixed by #74286
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior flang:frontend

Comments

@NimishMishra
Copy link
Contributor

LLVM Flang does not properly error out if an assumed rank variable is used as a dummy argument. Example -

program test
   implicit none
contains
   subroutine check(var)
      class(*), intent(in) :: var(..)
      select type (var)
      end select
   end subroutine
end program test

LLVM-flang does not complain with this example. gfortran, on the other hand, errors out with "Assumed rank variable var may only be used as actual argument"

@NimishMishra NimishMishra self-assigned this Dec 4, 2023
@github-actions github-actions bot added the flang Flang issues not falling into any other category label Dec 4, 2023
NimishMishra added a commit that referenced this issue Jan 3, 2024
…ELECT TYPE statement (#74286)

This patch adds a check to error out when an assumed rank variable is
used as dummy argument.

Fixes #74285
@EugeneZelenko EugeneZelenko added flang:frontend and removed flang Flang issues not falling into any other category labels Jan 3, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 3, 2024

@llvm/issue-subscribers-flang-frontend

Author: None (NimishMishra)

LLVM Flang does not properly error out if an assumed rank variable is used as a dummy argument. Example -
program test
   implicit none
contains
   subroutine check(var)
      class(*), intent(in) :: var(..)
      select type (var)
      end select
   end subroutine
end program test

LLVM-flang does not complain with this example. gfortran, on the other hand, errors out with "Assumed rank variable var may only be used as actual argument"

@psteinfeld psteinfeld added the bug Indicates an unexpected problem or unintended behavior label Jan 3, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 3, 2024

@llvm/issue-subscribers-bug

Author: None (NimishMishra)

LLVM Flang does not properly error out if an assumed rank variable is used as a dummy argument. Example -
program test
   implicit none
contains
   subroutine check(var)
      class(*), intent(in) :: var(..)
      select type (var)
      end select
   end subroutine
end program test

LLVM-flang does not complain with this example. gfortran, on the other hand, errors out with "Assumed rank variable var may only be used as actual argument"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior flang:frontend
Projects
None yet
4 participants