This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add one semantic check for masked array assignment
ClosedPublic

Authored by peixin on May 5 2022, 9:59 AM.

Details

Summary

As Fortran 2018 states, in each where-assignment-stmt, the mask-expr and
the variable being defined shall be arrays of the same shape. The
previous check does not consider checking if it is an array.

Diff Detail

Event Timeline

peixin created this revision.May 5 2022, 9:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2022, 9:59 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
peixin requested review of this revision.May 5 2022, 9:59 AM
klausler accepted this revision.May 5 2022, 10:08 AM
klausler added inline comments.
flang/lib/Semantics/assignment.cpp
223

This message is correct but it might be more clear to say that the variable and mask must not be scalars.

This revision is now accepted and ready to land.May 5 2022, 10:08 AM
peixin updated this revision to Diff 427573.May 6 2022, 2:35 AM

Change the semantic info into "The mask or variable must not be scalar" according to @klausler 's comments.

This revision was automatically updated to reflect the committed changes.