Skip to content

[flang] Missing diagnostic on intrinsic SIZE when the argumen DIM is equal to the rank. #139600

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

Closed
DanielCChen opened this issue May 12, 2025 · 2 comments
Labels
flang:frontend question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@DanielCChen
Copy link
Contributor

Consider the following code:

implicit none
real :: a(10, 10)
print*, size(a, dim=2)
end

The standard requires the DIM argument to be less than the rank of SOUCE. This usage should be diagnosed.

@llvmbot
Copy link
Member

llvmbot commented May 12, 2025

@llvm/issue-subscribers-flang-frontend

Author: Daniel Chen (DanielCChen)

Consider the following code: ``` implicit none real :: a(10, 10) print*, size(a, dim=2) end ```

The standard requires the DIM argument to be less than the rank of SOUCE. This usage should be diagnosed.

@klausler
Copy link
Contributor

The standard requires that DIM be less than or equal to the rank of the array, which it is in this case.

DIM must be present and less than the rank of the array only when the array is assumed-size. The compiler enforces this requirement correctly.

@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:frontend question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

4 participants