[flang-commits] [flang] [Flang][OpenMP] Reject substring and section-component in affinity (PR #184424)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 4 19:11:02 PST 2026


chichunchen wrote:

@tblah, I added a check for array sections, but the substring check is still needed.

The check for `StructureComponent` has been removed because it reflects a bug in the OpenMP 5.2 specification, as noted by @dreachem, and this is fixed in OpenMP 6.0. The restriction should apply only to variable list items and extended list items, but not to locator list items. Instead, `CheckLastPartRefForArraySection` has been added.

With this change:

- `a(1)%y` is accepted after removing the `StructureComponent` check (valid OpenMP array section usage).

- `a(1:n)%y` is rejected by `CheckLastPartRefForArraySection` (invalid OpenMP array section usage).

`a(1:n)%x(1:m)` is not rejected by `CheckLastPartRefForArraySection`, but it is rejected by C919a (“only one part-ref of a data-ref may have rank > 0”), so it is still invalid Fortran code.

The CI checks are currently failing due to an ICE that will be fixed by https://github.com/llvm/llvm-project/pull/184726
. I will merge this PR after #184726 lands.

https://github.com/llvm/llvm-project/pull/184424


More information about the flang-commits mailing list