This is an archive of the discontinued LLVM Phabricator instance.

[flang] Refine error checking in specification expressions
ClosedPublic

Authored by klausler on May 6 2022, 2:05 PM.

Details

Summary

The rules in the Fortran standard for specification expressions
are full of special cases and exceptions, and semantics didn't get
them exactly right. It is valid to refer to an INTENT(OUT) dummy
argument in a specification expression in the context of a
specification inquiry function like SIZE(); it is not valid to
reference an OPTIONAL dummy argument outside of the context of
PRESENT. This patch makes the specification expression checker
a little context-sensitive about whether it's examining an actual
argument of a specification inquiry intrinsic function or not.

Diff Detail

Event Timeline

klausler created this revision.May 6 2022, 2:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 2:05 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.May 6 2022, 2:05 PM
PeteSteinfeld accepted this revision.May 6 2022, 3:00 PM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.May 6 2022, 3:00 PM