This is an archive of the discontinued LLVM Phabricator instance.

[flang] Disallow BOZ literal constants as output list items
ClosedPublic

Authored by PeteSteinfeld on Jul 27 2021, 10:42 AM.

Details

Summary

According to C7109, "A boz-literal-constant shall appear only as a
data-stmt-constant in a DATA statement, or where explicitly allowed in
16.9 as an actual argument of an intrinsic procedure." This change
enforces that constraint for output list items.

I also added a general interface to determine if an expression is a BOZ
literal constant and changed all of the places I could find where it
could be used.

I also added a test.

This change stemmed from the following issue --

https://gitlab-master.nvidia.com/fortran/f18-stage/issues/108

Diff Detail

Event Timeline

PeteSteinfeld created this revision.Jul 27 2021, 10:42 AM
PeteSteinfeld requested review of this revision.Jul 27 2021, 10:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2021, 10:42 AM
PeteSteinfeld added a project: Restricted Project.
klausler accepted this revision.Jul 27 2021, 10:46 AM
klausler added inline comments.
flang/lib/Semantics/expression.cpp
161

It would be great if you could use the same capitalization for both of these predicates.

This revision is now accepted and ready to land.Jul 27 2021, 10:46 AM
PeteSteinfeld added inline comments.Jul 27 2021, 12:39 PM
flang/lib/Semantics/expression.cpp
161

Thanks, Peter. Will do.