[flang] Disallow BOZ literal constants as output list items
authorPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 27 Jul 2021 17:40:34 +0000 (10:40 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 27 Jul 2021 20:01:26 +0000 (13:01 -0700)
commit571673ce390a2f4973946c06801dfb2037115750
tree6261ec9cf6ca9f7df7f6d72831a9f219c4114e35
parentd7d2e4545e6b04ea29ffd05ebef2f7c26590b925
[flang] Disallow BOZ literal constants as output list items

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

Differential Revision: https://reviews.llvm.org/D106893
flang/include/flang/Evaluate/tools.h
flang/lib/Evaluate/intrinsics.cpp
flang/lib/Semantics/check-call.cpp
flang/lib/Semantics/check-io.cpp
flang/lib/Semantics/data-to-inits.cpp
flang/lib/Semantics/expression.cpp
flang/test/Semantics/boz-literal-constants.f90