[flang-commits] [flang] [flang] Error out when assumed rank variable is used as dummy argument (PR #74286)
via flang-commits
flang-commits at lists.llvm.org
Tue Dec 5 19:18:57 PST 2023
NimishMishra wrote:
> The title of this patch refers to dummy arguments, but the code itself seems to be testing the selector of a `SELECT TYPE` construct to implement a check to ensure that the selector is not assumed-rank. Where in the standard are assumed rank objects precluded from being used in `SELECT TYPE`?
Thank you for the comment. I can change the title of the patch.
The interpretation leading to this patch that I was following was C838 in the "An assumed-rank variable name shall not appear in a designator or expression except as an actual argument that corresponds to a dummy argument that is assumed-rank...". Since SELECT TYPE selectors are either designators or expressions (from parse-tree.h), my understanding was this restriction is transitively applicable in the current context too. Plus, seemed like C838 was also responsible for gfortran's semantic error on this test case.
https://github.com/llvm/llvm-project/pull/74286
More information about the flang-commits
mailing list