[flang] Disallow scalar argument to SIZE/LBOUND/UBOUND
authorPeter Klausler <pklausler@nvidia.com>
Mon, 20 Mar 2023 18:44:56 +0000 (11:44 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Tue, 28 Mar 2023 11:39:44 +0000 (04:39 -0700)
commitc6ec6e30867d07d5f641cdc34463a9588bdb9d22
tree5acc97238d99175305cf1379e61578f6136effb3
parent69bc8c9e2ad94fa367701b8ecadb39d693c41a3e
[flang] Disallow scalar argument to SIZE/LBOUND/UBOUND

The compiler accepts arguments of any rank, or assumed rank, to a host
of intrinsic inquiry functions.  For scalars, this is correct for most
of them, but the standard (and other compilers) prohibit scalar arguments
to SIZE, LBOUND, and UBOUND (without DIM=).

There are meaningful interpretations for these intrinsic inquiries
on scalars, but since there's no portability concern here, continuing
to support them would be an unjustifiable extension.

Differential Revision: https://reviews.llvm.org/D146587
flang/lib/Evaluate/intrinsics.cpp
flang/test/Semantics/misc-intrinsics.f90
flang/test/Semantics/symbol14.f90